OSSP CVS Repository

ossp - Check-in [3164]
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [Patchset]  [Tagging/Branching

Check-in Number: 3164
Date: 2003-Feb-06 15:23:49 (local)
2003-Feb-06 14:23:49 (UTC)
User:thl
Branch:
Comment: cast pid to/from int
Tickets:
Inspections:
Files:
ossp-pkg/lmtp2nntp/lmtp2nntp_main.c      1.64 -> 1.65     3 inserted, 3 deleted

ossp-pkg/lmtp2nntp/lmtp2nntp_main.c 1.64 -> 1.65

--- lmtp2nntp_main.c     2003/02/06 10:20:03     1.64
+++ lmtp2nntp_main.c     2003/02/06 14:23:49     1.65
@@ -478,7 +478,7 @@
     if (getuid() != ctx->option_uid) {
         if (setuid(ctx->option_uid) == -1) {
             fprintf(stderr, "%s:Error: Setting UID to %d failed: %s\n",
-                    ctx->progname, ctx->option_uid, strerror(errno));
+                    ctx->progname, (int)ctx->option_uid, strerror(errno));
             CU(ERR_EXECUTION);
         }
     }
@@ -487,7 +487,7 @@
         if ((fd = fopen(ctx->option_pidfile, "r")) == NULL)
             logbook(ctx->l2, L2_LEVEL_ERROR, "cannot open pidfile \"%s\" for reading %m", ctx->option_pidfile);
         else {
-            if (fscanf(fd, "%d\n", &pid) != 1) {
+            if (fscanf(fd, "%d\n", (int *)&pid) != 1) {
                 fclose(fd);
                 logbook(ctx->l2, L2_LEVEL_ERROR, "cannot extract pid from pidfile \"%s\"", ctx->option_pidfile);
             }
@@ -564,7 +564,7 @@
             if ((fd = fopen(ctx->option_pidfile, "w+")) == NULL)
                 logbook(ctx->l2, L2_LEVEL_ERROR, "cannot open pidfile \"%s\" for writing %m", ctx->option_pidfile);
             else {
-                fprintf(fd, "%d\n", getpid());
+                fprintf(fd, "%d\n", (int)getpid());
                 fclose(fd);
             }
         }

CVSTrac 2.0.1