first-free-port : meilleurs messages d'erreur
This commit is contained in:
parent
581fcd3f0a
commit
0b2c90d5ff
1 changed files with 3 additions and 3 deletions
|
@ -81,14 +81,14 @@ int main(int argc, char *argv[]) {
|
|||
}
|
||||
|
||||
if (!is_valid_tcp_port(current_port)) {
|
||||
fprintf(stderr, "Provide a valid TCP port number as first argument.\n");
|
||||
fprintf(stderr, "%s: provide a valid TCP port number as first argument.\n", argv[0]);
|
||||
return EX_USAGE;
|
||||
}
|
||||
|
||||
// Open TCP table
|
||||
FILE *tcp_table_fptr = fopen(TCP_TABLE, "r");
|
||||
if (tcp_table_fptr == NULL) {
|
||||
fprintf(stderr, "Error opening the TCP table.\n");
|
||||
fprintf(stderr, "%s: error opening the TCP table.\n", argv[0]);
|
||||
return EX_OSFILE;
|
||||
}
|
||||
|
||||
|
@ -106,7 +106,7 @@ int main(int argc, char *argv[]) {
|
|||
printf("%d\n", current_port);
|
||||
return EXIT_SUCCESS;
|
||||
} else {
|
||||
fprintf(stderr, "No more ports available. How did you fuck up that bad ???\n");
|
||||
fprintf(stderr, "%s: no more ports available; how did you fuck up that bad ???\n", argv[0]);
|
||||
return EX_TEMPFAIL;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue