Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1231327ybb; Fri, 3 Apr 2020 22:25:26 -0700 (PDT) X-Google-Smtp-Source: APiQypLhZ5PhNnFv6t0c+IIQe2fnVdICCgDaSZFwueRotI3NTSX9FwTJRttNum0/eU9zjlK4ICRl X-Received: by 2002:a4a:df05:: with SMTP id i5mr9796574oou.9.1585977926564; Fri, 03 Apr 2020 22:25:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585977926; cv=none; d=google.com; s=arc-20160816; b=CII2gX7exgAnGZQ9H8RR0ISaNL/jvibPu4Rb3T0td5O7F3erQYhd5+0BQ2tDaaOins 8Svj3vH2euXW1Jel6QqJHuNJp+pdPJBJ8GGZs2NBmW2nGjjiE9lacRwnJ7QD1thUWGS6 Sf1kt+rqjKufxHqCJYKj7u7eHFe+ul7ETEfeMnveCmTPaM0XZ5E0YDTWrGaKAa3sCOUD G08qgtMNaQ9/MkS02cdfFI4KvJg5IRcBq/H06Zw48K/m/VQENt9AuUQ6Nmn7sNcYUIAM uB0OHIOOl/BbGGUfQ59Sp7jWS52txNT41e1exHa9KZ1w0c7r0ybvxNpkGTEDPsTlAAhv il+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:to:from:dkim-signature; bh=ImWtC4Jz16nGF2vzYYftcDrbYkx4HuFFHw2ldXuCG2w=; b=GZeGwV+vILkrnXs20ksG2qnTUoJQqN5njLYdmmZNbwW9gQtzfIX/UIO01Ao2cokweB rDEXyDq4kk6s14kB/SuFFNS7tDltCcxYQUberi3F6eReeriguMLM1oeEMj3A642iTWRH xB0Eq6edNBShu89c2YlpkG8PUMDDqCVWzeyUl76PVY1acpmX1og3n8GpK9NTLtNBtQAx ZvfOoN7gbQeBbRZSKlqTXE5gdJo8DGCjTp4S7sQqhFdU/govtd+FRsq0wz3XObSdsxnT NrfKIlDQuNH7oG4uNrhMdG6T+8IhUvJ/k8pOZ5oD1FyUN0Nd3l1tuVkzKr6DQSt/yy+Q Appg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ojlPDbsD; spf=pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h10si4512601otm.153.2020.04.03.22.24.57; Fri, 03 Apr 2020 22:25:26 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ojlPDbsD; spf=pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725870AbgDDFY5 (ORCPT + 99 others); Sat, 4 Apr 2020 01:24:57 -0400 Received: from mail-pf1-f194.google.com ([209.85.210.194]:35754 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725837AbgDDFY4 (ORCPT ); Sat, 4 Apr 2020 01:24:56 -0400 Received: by mail-pf1-f194.google.com with SMTP id a13so4706310pfa.2 for ; Fri, 03 Apr 2020 22:24:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=ImWtC4Jz16nGF2vzYYftcDrbYkx4HuFFHw2ldXuCG2w=; b=ojlPDbsDISs79Q12lW8gMP3OgW8HjLO9N622wnWbRe0tQuLOhkP97UAFVn+Bu12RQ4 xvdwQLVdMXHqNlnWD7+B4NWXZDZ6AXIO2kJjJ3FZKu8Y87poQzovDU5NUgQlXZgd0aef bKUOm5YGBBZMrNKwWwBpJ58+7fPChNQDQgqK7kyoklmtEVnJr1G74S0TqavLFyu78Ip7 +yWvygJJyYiaHEByNzv5ax2dG6mvw9ZLhSqJsZyWaY84ZvV6MiKnWQLtPsmJPPvSyA3o DJVbRvwWCl5Wb1F7QBi0BAlbQJcYsRbU+IQNpt4r8pIVqsydao53d8Rp7Xc6jkL4HWu8 J1bA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=ImWtC4Jz16nGF2vzYYftcDrbYkx4HuFFHw2ldXuCG2w=; b=eBl2fBxfIW4zOQEem9/bQrwrROo952wwCp2K6Z82a4y4DpwjP8r/+SMi1c2lYhIsdT VWlhPI8D1FtQRJLoTd94tVjblifOsc+ow8V7FVg2Tg/i/J/7ReTenVQ/9ufm1yQp+UBs oD/QHPFomt2tsUyTcFnLi3opvxU2oZtyg4cguaA5eRR/nqhUq5holURp10ESSw/Q4fDg hCxVCpH2Mu8+oplESXIjQDEKMlFW0gf63WfPKZrq5vHl7FOQvUNkuXzKXc58QITgS2D6 gNh/QNiShlRCJpU5UHkc3kV9KuvWPbj1El7H8+8IGqNV4hcmLNy7AKcJTUOvNfpEaUZI keUQ== X-Gm-Message-State: AGi0Pubi48Jt9hhfnQ5nwLnG2XTWz4ldYLOf0i9HCckut4yGAmqpSp4z JoC3JYsHRBJ7E0rMwUyh9ZMvoWDW5Tw= X-Received: by 2002:a63:705d:: with SMTP id a29mr11142673pgn.304.1585977895337; Fri, 03 Apr 2020 22:24:55 -0700 (PDT) Received: from localhost.localdomain (astound-69-42-19-227.ca.astound.net. [69.42.19.227]) by smtp.gmail.com with ESMTPSA id n100sm6835531pjc.38.2020.04.03.22.24.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Apr 2020 22:24:54 -0700 (PDT) From: Rosen Penev To: linux-nfs@vger.kernel.org Subject: [PATCH 1/2] nfs-utils: print time in 64-bit Date: Fri, 3 Apr 2020 22:24:52 -0700 Message-Id: <20200404052453.2631191-1-rosenp@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org musl 1.2.0 defines time_t as 64-bit, even under 32-bit OSes. Fixes -Wformat errors. Signed-off-by: Rosen Penev --- support/nfs/cacheio.c | 3 ++- utils/idmapd/idmapd.c | 11 ++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/support/nfs/cacheio.c b/support/nfs/cacheio.c index 7c4cf373..126c1283 100644 --- a/support/nfs/cacheio.c +++ b/support/nfs/cacheio.c @@ -20,6 +20,7 @@ #endif #include +#include #include #include #include @@ -238,7 +239,7 @@ cache_flush(int force) stb.st_mtime > now) stb.st_mtime = time(0); - sprintf(stime, "%ld\n", stb.st_mtime); + sprintf(stime, "%" PRId64 "\n", (int64_t)stb.st_mtime); for (c=0; cachelist[c]; c++) { int fd; sprintf(path, "/proc/net/rpc/%s/flush", cachelist[c]); diff --git a/utils/idmapd/idmapd.c b/utils/idmapd/idmapd.c index c187e7d7..893159f1 100644 --- a/utils/idmapd/idmapd.c +++ b/utils/idmapd/idmapd.c @@ -54,6 +54,7 @@ #include #include #include +#include #include #include #include @@ -172,7 +173,7 @@ flush_nfsd_cache(char *path, time_t now) int fd; char stime[32]; - sprintf(stime, "%ld\n", now); + sprintf(stime, "%" PRId64 "\n", (int64_t)now); fd = open(path, O_RDWR); if (fd == -1) return -1; @@ -625,8 +626,8 @@ nfsdcb(int UNUSED(fd), short which, void *data) /* Name */ addfield(&bp, &bsiz, im.im_name); /* expiry */ - snprintf(buf1, sizeof(buf1), "%lu", - time(NULL) + cache_entry_expiration); + snprintf(buf1, sizeof(buf1), "%" PRId64, + (int64_t)time(NULL) + cache_entry_expiration); addfield(&bp, &bsiz, buf1); /* Note that we don't want to write the id if the mapping * failed; instead, by leaving it off, we write a negative @@ -653,8 +654,8 @@ nfsdcb(int UNUSED(fd), short which, void *data) snprintf(buf1, sizeof(buf1), "%u", im.im_id); addfield(&bp, &bsiz, buf1); /* expiry */ - snprintf(buf1, sizeof(buf1), "%lu", - time(NULL) + cache_entry_expiration); + snprintf(buf1, sizeof(buf1), "%" PRId64, + (int64_t)time(NULL) + cache_entry_expiration); addfield(&bp, &bsiz, buf1); /* Note we're ignoring the status field in this case; we'll * just map to nobody instead. */ -- 2.25.1