svn commit: r229241 - stable/9/usr.sbin/rpc.ypupdated

Dimitry Andric dim at FreeBSD.org
Sun Jan 1 23:39:57 UTC 2012


Author: dim
Date: Sun Jan  1 23:39:56 2012
New Revision: 229241
URL: http://svn.freebsd.org/changeset/base/229241

Log:
  MFC r228678:
  
    In usr.sbin/rpc.ypupdated/yp_dbupdate.c, use the appropriate printf
    length modifier for time_t (after casting it to intmax_t).
  
  MFC r228679:
  
    In usr.sbin/rpc.ypupdated/yp_dbupdate.c, include stdint.h, so intmax_t
    is known, otherwise it won't build.
  
    Pointy hat to:	dim
  
  MFC r228680:
  
    In usr.sbin/rpc.ypupdated/yp_dbupdate.c, since intmax_t is signed, just
    like time_t, better use %jd instead of %ju.  Strangely enough, neither
    gcc, clang nor gcc 4.6 warn about this discrepancy...

Modified:
  stable/9/usr.sbin/rpc.ypupdated/yp_dbupdate.c
Directory Properties:
  stable/9/usr.sbin/rpc.ypupdated/   (props changed)

Modified: stable/9/usr.sbin/rpc.ypupdated/yp_dbupdate.c
==============================================================================
--- stable/9/usr.sbin/rpc.ypupdated/yp_dbupdate.c	Sun Jan  1 23:36:13 2012	(r229240)
+++ stable/9/usr.sbin/rpc.ypupdated/yp_dbupdate.c	Sun Jan  1 23:39:56 2012	(r229241)
@@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$");
 
 #include <sys/fcntl.h>
 
+#include <stdint.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -130,7 +131,7 @@ ypmap_update(char *netname, char *map, u
 		return(rval);
 	}
 
-	snprintf(yplastbuf, sizeof(yplastbuf), "%lu", time(NULL));
+	snprintf(yplastbuf, sizeof(yplastbuf), "%jd", (intmax_t)time(NULL));
 	key.data = yp_last;
 	key.size = strlen(yp_last);
 	data.data = (char *)&yplastbuf;


More information about the svn-src-stable-9 mailing list