Changeset b19e892 in mainline for uspace/app/getterm/getterm.c
- Timestamp:
- 2017-04-02T10:39:13Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 9c4cf0d
- Parents:
- 80743a1
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/getterm/getterm.c
r80743a1 rb19e892 36 36 37 37 #include <sys/types.h> 38 #include <fcntl.h>39 38 #include <unistd.h> 40 39 #include <stdio.h> … … 59 58 } 60 59 61 static void reopen(FILE **stream, int fd, const char *path, int flags,62 const char * mode)60 static void reopen(FILE **stream, int fd, const char *path, int mode, 61 const char *fmode) 63 62 { 64 63 if (fclose(*stream)) … … 67 66 *stream = NULL; 68 67 69 int oldfd = open(path, flags);68 int oldfd = vfs_lookup_open(path, WALK_REGULAR, mode); 70 69 if (oldfd < 0) 71 70 return; … … 79 78 } 80 79 81 *stream = fdopen(fd, mode);80 *stream = fdopen(fd, fmode); 82 81 } 83 82 … … 142 141 snprintf(term_node, LOC_NAME_MAXLEN, "%s/%s", locfs, term); 143 142 144 reopen(&stdin, 0, term_node, O_RDONLY, "r");145 reopen(&stdout, 1, term_node, O_WRONLY, "w");146 reopen(&stderr, 2, term_node, O_WRONLY, "w");143 reopen(&stdin, 0, term_node, MODE_READ, "r"); 144 reopen(&stdout, 1, term_node, MODE_WRITE, "w"); 145 reopen(&stderr, 2, term_node, MODE_WRITE, "w"); 147 146 148 147 if (stdin == NULL)
Note:
See TracChangeset
for help on using the changeset viewer.