Fix pid_t printing
authorRainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
Fri, 28 Jul 2017 16:26:39 +0000 (16:26 +0000)
committerRainer Orth <ro@gcc.gnu.org>
Fri, 28 Jul 2017 16:26:39 +0000 (16:26 +0000)
* fileline.c (fileline_initialize): Print pid_t as long.

From-SVN: r250675

libbacktrace/ChangeLog
libbacktrace/fileline.c

index 52154f01e825ee567ccde30da1b64d710c3349ae..c60f714aa20dc63e0632479477f2945132885a1d 100644 (file)
@@ -1,3 +1,7 @@
+2017-07-28  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
+
+       * fileline.c (fileline_initialize): Print pid_t as long.
+
 2017-07-26  Tony Reix  <tony.reix@atos.net>
 
        * configure.ac: Check for XCOFF32/XCOFF64.  Check for loadquery.
index 303e4dce83a737b3b441dba873a75a5020b6ab3a..68120583d7bbc765dfaadb37f0f9a0fc23d559ef 100644 (file)
@@ -102,7 +102,8 @@ fileline_initialize (struct backtrace_state *state,
          filename = "/proc/curproc/file";
          break;
        case 4:
-         snprintf (buf, sizeof (buf), "/proc/%d/object/a.out", getpid ());
+         snprintf (buf, sizeof (buf), "/proc/%ld/object/a.out",
+                   (long) getpid ());
          filename = buf;
          break;
        default: