/* Combine two dump files, either by appending or by merging by timestamp
*
- * $Id: mergecap.c,v 1.24 2004/06/30 07:04:42 guy Exp $
+ * $Id$
*
* Written by Scott Renfro <scott@renfro.org> based on
* editcap by Richard Sharpe and Guy Harris
#include <stdio.h>
#include <stdlib.h>
+#include <errno.h>
#include <glib.h>
#ifdef HAVE_UNISTD_H
#include "getopt.h"
#endif
-#include "cvsversion.h"
+#include "svnversion.h"
#include "merge.h"
#ifdef HAVE_IO_H
case 'h':
printf("mergecap version %s"
-#ifdef CVSVERSION
- " (" CVSVERSION ")"
+#ifdef SVNVERSION
+ " (" SVNVERSION ")"
#endif
"\n", VERSION);
usage();
out_file.fd = 1 /*stdout*/;
} else {
/* open the outfile */
- out_file.fd = open(out_filename, O_BINARY | O_WRONLY);
+ out_file.fd = open(out_filename, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, 0644);
}
- if(out_file.fd == -1) {
- fprintf(stderr, "mergecap: couldn't open output file\n");
+ if (out_file.fd == -1) {
+ fprintf(stderr, "mergecap: Couldn't open output file %s: %s\n",
+ out_filename, strerror(errno));
exit(1);
}