Re: [PATCH] Port leak when using clisp
Samuel Thibault, le Fri 28 Aug 2015 01:37:07 +0200, a écrit : > Applied, thanks! I believe it fixed a few other packages in debian. Samuel
netdde drivers
Hello, As it seems we'll never synchronize netdde with DDE but rather go with Rump, I have pushed the changes we've been using in Debian to get 2.6.32 kernel support. I have also unblacklisted the atl2 driver, as prompted by a user. There are probably more such drivers which I have erroneously blacklisted through whole directories, perhaps people can try to enable them one by one to check whether they build, and contribute what could be unblacklisted. Samuel
[PATCH] Change file_utimes RPC to use a struct timespec and update the servers to use UTIME_NOW and UTIME_OMIT.
From: Flávio Cruz Hello These two patches allow the glibc and the hurd servers to handle UTIME_OMIT and UTIME_NOW in futimens. The file_utimes RPC now uses a struct timespec instead of a timeval. --- console-client/trans.c | 8 ++-- console/console.c | 8 ++-- ext2fs/pager.c | 3 +++ ftpfs/netfs.c | 8 ++-- hostmux/node.c | 8 ++-- hurd/fs.defs | 4 ++-- libdiskfs/file-utimes.c| 20 +++ libnetfs/file-utimes.c | 40 +++-- libnetfs/init-init.c | 6 ++ libnetfs/netfs.h | 2 +- libnetfs/priv.h| 2 ++ libtreefs/s-file.c | 2 +- libtreefs/treefs-s-hooks.h | 2 +- libtrivfs/file-utimes.c| 2 +- libtrivfs/times.c | 24 +++--- nfs/nfs.c | 50 -- nfs/ops.c | 14 - nfsd/ops.c | 46 +- trans/fakeroot.c | 29 +-- usermux/node.c | 8 ++-- 20 files changed, 153 insertions(+), 133 deletions(-) diff --git a/console-client/trans.c b/console-client/trans.c index 224229e..4c78e46 100644 --- a/console-client/trans.c +++ b/console-client/trans.c @@ -186,14 +186,10 @@ netfs_attempt_utimes (struct iouser *cred, struct node *np, if (! err) { if (mtime) - np->nn_stat.st_mtim = *mtime; - else -flags |= TOUCH_MTIME; +np->nn_stat.st_mtim = *mtime; if (atime) - np->nn_stat.st_atim = *atime; - else -flags |= TOUCH_ATIME; +np->nn_stat.st_atim = *atime; fshelp_touch (&np->nn_stat, flags, console_maptime); } diff --git a/console/console.c b/console/console.c index 57ae813..1be1112 100644 --- a/console/console.c +++ b/console/console.c @@ -506,14 +506,10 @@ netfs_attempt_utimes (struct iouser *cred, struct node *node, if (! err) { if (mtime) - node->nn_stat.st_mtim = *mtime; - else - flags |= TOUCH_MTIME; +node->nn_stat.st_mtim = *mtime; if (atime) - node->nn_stat.st_atim = *atime; - else - flags |= TOUCH_ATIME; +node->nn_stat.st_atim = *atime; fshelp_touch (&node->nn_stat, flags, console_maptime); } diff --git a/ext2fs/pager.c b/ext2fs/pager.c index b56c923..4f56743 100644 --- a/ext2fs/pager.c +++ b/ext2fs/pager.c @@ -1220,6 +1220,9 @@ create_disk_pager (void) err = pager_start_workers (file_pager_bucket); if (err) ext2_panic ("can't create libpager worker threads: %s", strerror (err)); +#ifdef STAT + +#endif } /* Call this to create a FILE_DATA pager and return a send right. diff --git a/ftpfs/netfs.c b/ftpfs/netfs.c index cf5d907..b0c80db 100644 --- a/ftpfs/netfs.c +++ b/ftpfs/netfs.c @@ -77,14 +77,10 @@ netfs_attempt_utimes (struct iouser *cred, struct node *node, if (! err) { if (atime) - node->nn_stat.st_atim = *atime; - else - flags |= TOUCH_ATIME; +node->nn_stat.st_atim = *atime; if (mtime) - node->nn_stat.st_mtim = *mtime; - else - flags |= TOUCH_MTIME; +node->nn_stat.st_mtim = *mtime; fshelp_touch (&node->nn_stat, flags, ftpfs_maptime); } diff --git a/hostmux/node.c b/hostmux/node.c index 7167300..0724d35 100644 --- a/hostmux/node.c +++ b/hostmux/node.c @@ -79,14 +79,10 @@ netfs_attempt_utimes (struct iouser *cred, struct node *node, if (! err) { if (mtime) - node->nn_stat.st_mtim = *mtime; - else - flags |= TOUCH_MTIME; + node->nn_stat.st_mtim = *mtime; if (atime) - node->nn_stat.st_atim = *atime; - else - flags |= TOUCH_ATIME; + node->nn_stat.st_atim = *atime; fshelp_touch (&node->nn_stat, flags, hostmux_maptime); } diff --git a/hurd/fs.defs b/hurd/fs.defs index a4a48cc..1514a84 100644 --- a/hurd/fs.defs +++ b/hurd/fs.defs @@ -99,8 +99,8 @@ routine file_chflags ( routine file_utimes ( utimes_file: file_t; RPT - new_atime: time_value_t; - new_mtime: time_value_t); + new_atime: timespec_t; + new_mtime: timespec_t); /* Change the size of the file. If the size increases, new blocks are zero-filled. After successful return, it is safe to reference mapped diff --git a/libdiskfs/file-utimes.c b/libdiskfs/file-utimes.c index 39fac50..d525e81 100644 --- a/libdiskfs/file-utimes.c +++ b/libdiskfs/file-utimes.c @@ -21,28 +21,32 @@ /* Implement file_utimes as described in . */ kern_return_t diskfs_S_file_utimes (struct protid *cred, - time_value_t atime, - time_value_t mtime) + struct timespec atime, + struct timespec mtime) { CHANGE_NODE_FIELD (cred, ({
[PATCH] Add Hurd support for UTIME_OMIT and UTIME_NOW.
From: Flávio Cruz This fixes the bug described in https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=762677 --- sysdeps/mach/hurd/bits/stat.h | 4 sysdeps/mach/hurd/futimens.c | 17 ++--- sysdeps/mach/hurd/futimes.c | 25 ++--- sysdeps/mach/hurd/lutimes.c | 25 ++--- sysdeps/mach/hurd/utimes.c| 25 ++--- 5 files changed, 56 insertions(+), 40 deletions(-) diff --git a/sysdeps/mach/hurd/bits/stat.h b/sysdeps/mach/hurd/bits/stat.h index f60a58a..c2d0cc2 100644 --- a/sysdeps/mach/hurd/bits/stat.h +++ b/sysdeps/mach/hurd/bits/stat.h @@ -246,6 +246,10 @@ struct stat64 # define SF_NOUNLINK 0x0010 /* file may not be removed or renamed */ # define SF_SNAPSHOT 0x0020 /* snapshot inode */ +/* Time flags for futimens. */ +#define UTIME_NOW -1 /* corresponds to the current time */ +#define UTIME_OMIT -2 /* target time is omitted */ + __BEGIN_DECLS /* Set file flags for FILE to FLAGS. */ diff --git a/sysdeps/mach/hurd/futimens.c b/sysdeps/mach/hurd/futimens.c index 4f82f1e..e3c30ae 100644 --- a/sysdeps/mach/hurd/futimens.c +++ b/sysdeps/mach/hurd/futimens.c @@ -27,21 +27,24 @@ int __futimens (int fd, const struct timespec tsp[2]) { - time_value_t atime, mtime; + struct timespec atime, mtime; error_t err; if (tsp == NULL) { - /* Setting the number of microseconds to `-1' tells the + /* Setting the number of nanoseconds to UTIME_NOW tells the underlying filesystems to use the current time. */ - atime.microseconds = mtime.microseconds = -1; + atime.tv_sec = 0; + atime.tv_nsec = UTIME_NOW; + mtime.tv_sec = 0; + mtime.tv_nsec = UTIME_NOW; } else { - atime.seconds = tsp[0].tv_sec; - atime.microseconds = tsp[0].tv_nsec / 1000; - mtime.seconds = tsp[1].tv_sec; - mtime.microseconds = tsp[1].tv_nsec / 1000; + atime.tv_sec = tsp[0].tv_sec; + atime.tv_nsec = tsp[0].tv_nsec; + mtime.tv_sec = tsp[1].tv_sec; + mtime.tv_nsec = tsp[1].tv_nsec; } err = HURD_DPORT_USE (fd, __file_utimes (port, atime, mtime)); diff --git a/sysdeps/mach/hurd/futimes.c b/sysdeps/mach/hurd/futimes.c index c325d44..d2440e8 100644 --- a/sysdeps/mach/hurd/futimes.c +++ b/sysdeps/mach/hurd/futimes.c @@ -27,24 +27,27 @@ int __futimes (int fd, const struct timeval tvp[2]) { - union tv - { -struct timeval tv; -time_value_t tvt; - }; - const union tv *u = (const union tv *) tvp; - union tv nulltv[2]; + struct timespec u[2]; error_t err; if (tvp == NULL) { - /* Setting the number of microseconds to `-1' tells the + /* Setting the number of microseconds to UTIME_NOW tells the underlying filesystems to use the current time. */ - nulltv[0].tvt.microseconds = nulltv[1].tvt.microseconds = -1; - u = nulltv; + u[0].tv_sec = 0; + u[0].tv_nsec = UTIME_NOW; + u[1].tv_sec = 0; + u[2].tv_nsec = UTIME_NOW; +} + else +{ + u[0].tv_sec = tvp[0].tv_sec; + u[0].tv_nsec = tvp[0].tv_usec * 1000; + u[1].tv_sec = tvp[1].tv_sec; + u[1].tv_nsec = tvp[1].tv_usec * 1000; } - err = HURD_DPORT_USE (fd, __file_utimes (port, u[0].tvt, u[1].tvt)); + err = HURD_DPORT_USE (fd, __file_utimes (port, u[0], u[1])); return err ? __hurd_dfail (fd, err) : 0; } weak_alias (__futimes, futimes) diff --git a/sysdeps/mach/hurd/lutimes.c b/sysdeps/mach/hurd/lutimes.c index 260842d..32a5a9c 100644 --- a/sysdeps/mach/hurd/lutimes.c +++ b/sysdeps/mach/hurd/lutimes.c @@ -27,28 +27,31 @@ int __lutimes (const char *file, const struct timeval tvp[2]) { - union tv - { -struct timeval tv; -time_value_t tvt; - }; - const union tv *u = (const union tv *) tvp; - union tv nulltv[2]; + struct timespec u[2]; error_t err; file_t port; if (tvp == NULL) { - /* Setting the number of microseconds to `-1' tells the + /* Setting the number of microseconds to UTIME_NOW tells the underlying filesystems to use the current time. */ - nulltv[0].tvt.microseconds = nulltv[1].tvt.microseconds = -1; - u = nulltv; + u[0].tv_sec = 0; + u[0].tv_nsec = UTIME_NOW; + u[1].tv_sec = 0; + u[2].tv_nsec = UTIME_NOW; +} + else +{ + u[0].tv_sec = tvp[0].tv_sec; + u[0].tv_nsec = tvp[0].tv_usec * 1000; + u[1].tv_sec = tvp[1].tv_sec; + u[1].tv_nsec = tvp[1].tv_usec * 1000; } port = __file_name_lookup (file, O_NOLINK, 0); if (port == MACH_PORT_NULL) return -1; - err = __file_utimes (port, u[0].tvt, u[1].tvt); + err = __file_utimes (port, u[0], u[1]); __mach_port_deallocate (__mach_task_self (), port); if (err) return __hurd_fail (err); diff --git a/sysdeps/mach/hurd/utimes.c b/sysdeps/mach/hurd/utimes.c index 6739b79..97f61d7 100644 --- a/sysdeps/mach/hurd/utimes.c +++ b/sysdeps/mach/hurd/utimes.c @@ -27,28 +27,31 @@ __utimes (file, tvp) co