Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 1 Jan 2012 23:39:56 +0000 (UTC)
From:      Dimitry Andric <dim@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject:   svn commit: r229241 - stable/9/usr.sbin/rpc.ypupdated
Message-ID:  <201201012339.q01NduaQ037408@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201201012339.q01NduaQ037408>