aboutsummaryrefslogtreecommitdiffstats
path: root/reordercap.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2013-07-26 21:25:33 +0000
committerGuy Harris <guy@alum.mit.edu>2013-07-26 21:25:33 +0000
commit9df4d49905a0cae63ec967f9cbe93570022bf3fb (patch)
tree8ca6c5cde389486b46217fac294adba8d64cc29d /reordercap.c
parent8d81fe9a0ea725ae07071e5cc6e6cee840dd4c08 (diff)
Send error messages to the standard error, and include the program name
in the error message. svn path=/trunk/; revision=50928
Diffstat (limited to 'reordercap.c')
-rw-r--r--reordercap.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/reordercap.c b/reordercap.c
index 2f809e8cea..1e29303908 100644
--- a/reordercap.c
+++ b/reordercap.c
@@ -108,7 +108,8 @@ frame_write(FrameRecord_t *frame, wtap *wth, wtap_dumper *pdh, Buffer *buf)
/* Dump frame to outfile */
if (!wtap_dump(pdh, &phdr, buffer_start_ptr(buf), &err)) {
- printf("Error (%s) writing frame to outfile\n", wtap_strerror(err));
+ fprintf(stderr, "reordercap: Error (%s) writing frame to outfile\n",
+ wtap_strerror(err));
exit(1);
}
}
@@ -200,7 +201,8 @@ int main(int argc, char *argv[])
/* Open infile */
wth = wtap_open_offline(infile, &err, &err_info, TRUE);
if (wth == NULL) {
- printf("reorder: Can't open %s: %s\n", infile, wtap_strerror(err));
+ fprintf(stderr, "reordercap: Can't open %s: %s\n", infile,
+ wtap_strerror(err));
exit(1);
}
DEBUG_PRINT("file_type is %u\n", wtap_file_type(wth));
@@ -213,7 +215,8 @@ int main(int argc, char *argv[])
65535, FALSE, shb_hdr, idb_inf, &err);
g_free(idb_inf);
if (pdh == NULL) {
- printf("Failed to open output file: (%s) - error %s\n", outfile, wtap_strerror(err));
+ fprintf(stderr, "reordercap: Failed to open output file: (%s) - error %s\n",
+ outfile, wtap_strerror(err));
g_free(shb_hdr);
exit(1);
}
@@ -269,7 +272,8 @@ int main(int argc, char *argv[])
/* Close outfile */
if (!wtap_dump_close(pdh, &err)) {
- printf("Error closing %s: %s\n", outfile, wtap_strerror(err));
+ fprintf(stderr, "reordercap: Error closing %s: %s\n", outfile,
+ wtap_strerror(err));
g_free(shb_hdr);
exit(1);
}