]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Use __func__ in some error messages in compress_savefile()
authorFrancois-Xavier Le Bail <[email protected]>
Fri, 4 Apr 2025 14:49:01 +0000 (16:49 +0200)
committerfxlb <[email protected]>
Fri, 4 Apr 2025 18:48:40 +0000 (18:48 +0000)
tcpdump.c

index d2af6e6908b45140df68e5452c06281cbf7bc34e..5f9a34bf4296e62babc80893c928b486cdd75ff0 100644 (file)
--- a/tcpdump.c
+++ b/tcpdump.c
@@ -3106,8 +3106,8 @@ compress_savefile(const char *filename)
        child = fork_subprocess();
        if (child == -1) {
                fprintf(stderr,
-                       "compress_savefile: fork failed: %s\n",
-                       pcap_strerror(errno));
+                       "%s: fork failed: %s\n",
+                       __func__, pcap_strerror(errno));
                return;
        }
        if (child != 0) {
@@ -3126,10 +3126,8 @@ compress_savefile(const char *filename)
 #endif
        if (execlp(zflag, zflag, filename, (char *)NULL) == -1)
                fprintf(stderr,
-                       "compress_savefile: execlp(%s, %s) failed: %s\n",
-                       zflag,
-                       filename,
-                       pcap_strerror(errno));
+                       "%s: execlp(%s, %s) failed: %s\n",
+                       __func__, zflag, filename, pcap_strerror(errno));
 #ifdef HAVE_FORK
        exit(S_ERR_HOST_PROGRAM);
 #else
@@ -3141,7 +3139,8 @@ static void
 compress_savefile(const char *filename)
 {
        fprintf(stderr,
-               "compress_savefile failed. Functionality not implemented under your system\n");
+               "%s failed. Functionality not implemented under your system\n",
+               __func__);
 }
 #endif /* HAVE_FORK && HAVE_VFORK */