Changeset 32573ff in mainline for uspace/app/bdsh/cmds/modules/mkfile/mkfile.c
- Timestamp:
- 2016-05-02T20:58:16Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 7c4b26c
- Parents:
- 6adb775f (diff), 5035ba05 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/bdsh/cmds/modules/mkfile/mkfile.c
r6adb775f r32573ff 165 165 const char byte = 0x00; 166 166 167 if ((rc2 = lseek(fd, file_size - 1, SEEK_SET)) < 0) 167 if ((rc2 = lseek(fd, file_size - 1, SEEK_SET)) < 0) { 168 close(fd); 168 169 goto error; 170 } 169 171 170 172 rc2 = write(fd, &byte, sizeof(char)); 171 if (rc2 < 0) 173 if (rc2 < 0) { 174 close(fd); 172 175 goto error; 176 } 173 177 return CMD_SUCCESS; 174 178 } … … 187 191 printf("%s: Error writing file (%d).\n", cmdname, errno); 188 192 close(fd); 193 free(buffer); 189 194 return CMD_FAILURE; 190 195 }
Note:
See TracChangeset
for help on using the changeset viewer.