Changeset a35b458 in mainline for uspace/app/bdsh/cmds/modules/touch/touch.c
- Timestamp:
- 2018-03-02T20:10:49Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f1380b7
- Parents:
- 3061bc1
- git-author:
- Jiří Zárevúcky <zarevucky.jiri@…> (2018-02-28 17:38:31)
- git-committer:
- Jiří Zárevúcky <zarevucky.jiri@…> (2018-03-02 20:10:49)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/bdsh/cmds/modules/touch/touch.c
r3061bc1 ra35b458 69 69 cmdname); 70 70 } 71 71 72 72 return; 73 73 } … … 85 85 int fd = -1; 86 86 char *buff = NULL; 87 87 88 88 DIR *dirp; 89 89 90 90 for (c = 0, optreset = 1, optind = 0, longind = 0; c != -1; ) { 91 91 c = getopt_long(argc, argv, "c", long_options, &longind); … … 96 96 } 97 97 } 98 98 99 99 if (argc - optind < 1) { 100 100 printf("%s: Incorrect number of arguments. Try `help %s extended'\n", … … 102 102 return CMD_FAILURE; 103 103 } 104 104 105 105 for (i = optind; argv[i] != NULL; i++) { 106 106 buff = str_dup(argv[i]); … … 110 110 continue; 111 111 } 112 112 113 113 dirp = opendir(buff); 114 114 if (dirp) { … … 119 119 continue; 120 120 } 121 121 122 122 /* Check whether file exists if -c (--no-create) option is given */ 123 123 if ((!no_create) || … … 128 128 } 129 129 } 130 130 131 131 if (fd < 0) { 132 132 cli_error(CL_EFAIL, "Could not update or create `%s'", buff); … … 138 138 fd = -1; 139 139 } 140 140 141 141 free(buff); 142 142 } 143 143 144 144 if (ret) 145 145 return CMD_FAILURE;
Note:
See TracChangeset
for help on using the changeset viewer.