projects
/
gapil.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Ancora revisione segnali
[gapil.git]
/
sources
/
test_initfile.c
diff --git
a/sources/test_initfile.c
b/sources/test_initfile.c
index 12dc0280ec65548a6c7f24f28f6946756ca17f85..afd607391aba85f78b3febff105b6c52584aba95 100644
(file)
--- a/
sources/test_initfile.c
+++ b/
sources/test_initfile.c
@@
-99,6
+99,10
@@
int main(int argc, char *argv[])
int newfd, res, count;
count = strlen(argv[optind+1]);
newfd = open(dir, O_PATH|O_RDWR);
int newfd, res, count;
count = strlen(argv[optind+1]);
newfd = open(dir, O_PATH|O_RDWR);
+ if (newfd < 0) {
+ perror("Cannot open destination dir");
+ exit(1);
+ }
res = InitFile(newfd, file, argv[optind+1], count);
free(path);
return 0;
res = InitFile(newfd, file, argv[optind+1], count);
free(path);
return 0;
@@
-107,8
+111,7
@@
int main(int argc, char *argv[])
* routine to print usage info and exit
*/
void usage(void) {
* routine to print usage info and exit
*/
void usage(void) {
- printf("Program test_initfile : test initfile \n");
- printf("Create a link to a tempfile or a link to -f indicated file");
+ printf("Program test_initfile : create a file with initial content \n");
printf("Usage:\n");
printf(" test_initfile [-h] pathname 'test to be written on pathname' \n");
printf(" -h print this help\n");
printf("Usage:\n");
printf(" test_initfile [-h] pathname 'test to be written on pathname' \n");
printf(" -h print this help\n");