From: Kay Sievers <kay.sievers@vrfy.org>
To: linux-hotplug@vger.kernel.org
Subject: Re: [PATCH] Use utime rather than utimes
Date: Wed, 10 Mar 2010 11:47:56 +0000 [thread overview]
Message-ID: <1268221676.1950.1.camel@yio.site> (raw)
In-Reply-To: <1268195770-20935-1-git-send-email-jon@ringle.org>
On Wed, 2010-03-10 at 12:35 +0100, Kay Sievers wrote:
> On Wed, Mar 10, 2010 at 10:22, Martin Pitt <martin.pitt@ubuntu.com> wrote:
> > Kay Sievers [2010-03-10 9:34 +0100]:
> >> utime(): POSIX.1-2008 marks utime() as obsolete.
> >
> > That's actually what the manpage says, indeed. However, it contradicts
> > what's written in the standard:
> >
> > http://www.opengroup.org/onlinepubs/009695399/basedefs/sys/time.h.html#tag_13_64
> >
> > says utimes() is obsolete and
> >
> > http://www.opengroup.org/onlinepubs/009695399/basedefs/utime.h.html#tag_13_81
> >
> > says nothing about being obsolete. However, this might not be _the_
> > POSIX standard?
>
> Sounds all pretty weird. Maybe we just go for utimensat(AT_FDCWD,
> ..., if that is in uclibc. Jon, care to check?
Jon, care to try if this compiles?
Thanks,
Kay
diff --git a/udev/udev-node.c b/udev/udev-node.c
index a70c147..23bfade 100644
--- a/udev/udev-node.c
+++ b/udev/udev-node.c
@@ -57,7 +57,7 @@ int udev_node_mknod(struct udev_device *dev, const char *file, dev_t devnum, mod
preserve = 1;
udev_selinux_lsetfilecon(udev, file, mode);
/* update time stamp when we re-use the node, like on media change events */
- utimes(file, NULL);
+ utimensat(AT_FDCWD, file, NULL, 0);
} else {
char file_tmp[UTIL_PATH_SIZE + sizeof(TMP_FILE_EXT)];
@@ -178,7 +178,7 @@ static int node_symlink(struct udev *udev, const char *node, const char *slink)
info(udev, "preserve already existing symlink '%s' to '%s'\n",
slink, target);
udev_selinux_lsetfilecon(udev, slink, S_IFLNK);
- lutimes(slink, NULL);
+ utimensat(AT_FDCWD, slink, NULL, AT_SYMLINK_NOFOLLOW);
goto exit;
}
}
next prev parent reply other threads:[~2010-03-10 11:47 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-10 4:36 [PATCH] Use utime rather than utimes Jon Ringle
2010-03-10 8:34 ` Kay Sievers
2010-03-10 9:22 ` Martin Pitt
2010-03-10 11:35 ` Kay Sievers
2010-03-10 11:47 ` Kay Sievers [this message]
2010-03-10 13:56 ` Scott James Remnant
2010-03-10 15:32 ` Jon Ringle
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1268221676.1950.1.camel@yio.site \
--to=kay.sievers@vrfy.org \
--cc=linux-hotplug@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).