diff options
author | Roland McGrath <roland@gnu.org> | 2002-05-08 10:11:55 +0000 |
---|---|---|
committer | Roland McGrath <roland@gnu.org> | 2002-05-08 10:11:55 +0000 |
commit | f38103ab4f6453e3de05156371992d6471e97089 (patch) | |
tree | ff23befa467fd65489f520913745728d7ae32003 /nfs | |
parent | ee4224208f256fb8616c722439b99fabc00c5e8d (diff) |
2002-05-08 Roland McGrath <roland@frob.com>
* ops.c (netfs_attempt_unlink): Use %tx and ptrdiff_t.
Diffstat (limited to 'nfs')
-rw-r--r-- | nfs/ops.c | 15 |
1 files changed, 8 insertions, 7 deletions
@@ -1,5 +1,5 @@ /* Libnetfs callbacks for node operations in NFS client - Copyright (C) 1994, 1995, 1996, 1997, 1999 Free Software Foundation + Copyright (C) 1994,95,96,97,99,2002 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as @@ -21,6 +21,7 @@ #include <string.h> #include <fcntl.h> #include <stdio.h> +#include <stddef.h> #include <dirent.h> #include <unistd.h> #include <maptime.h> @@ -88,7 +89,7 @@ process_returned_stat (struct node *np, int *p, int mod) else { int attrs_exist; - + attrs_exist = ntohl (*p++); if (attrs_exist) p = register_fresh_stat (np, p); @@ -290,7 +291,7 @@ netfs_attempt_utimes (struct iouser *cred, struct node *np, error_t err; struct timeval tv; struct timespec current; - + /* XXX For version 3 we can actually do this right, but we don't just yet. */ if (!atime || !mtime) @@ -306,8 +307,8 @@ netfs_attempt_utimes (struct iouser *cred, struct node *np, return errno; p = xdr_encode_fhandle (p, &np->nn->handle); - p = xdr_encode_sattr_times (p, - atime ?: ¤t, + p = xdr_encode_sattr_times (p, + atime ?: ¤t, mtime ?: ¤t); if (protocol_version == 3) *p++ = 0; /* guard check == 0 */ @@ -1222,7 +1223,7 @@ netfs_attempt_unlink (struct iouser *cred, struct node *dir, away entirely. */ if (np->references > 1) { - char *newname; + char *newname = 0; int n = 0; mutex_unlock (&dir->lock); @@ -1237,7 +1238,7 @@ netfs_attempt_unlink (struct iouser *cred, struct node *dir, do { - sprintf (newname, ".nfs%xgnu.%d", (int) np, n++); + sprintf (newname, ".nfs%txgnu.%d", (ptrdiff_t) np, n++); err = netfs_attempt_link (cred, dir, np, newname, 1); } while (err == EEXIST); |