mailing list of musl libc
 help / color / mirror / code / Atom feed
abc8d743bd1340e82ea996ff3976af8bb18f9dab blob 975 bytes (raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
 
#include <sys/stat.h>
#include <sys/time.h>
#include <fcntl.h>
#include <errno.h>
#include "syscall.h"

int utimensat(int fd, const char *path, const struct timespec times[2], int flags)
{
	int r = __syscall(SYS_utimensat, fd, path, times, flags);
	if (r != -ENOSYS || flags) return __syscall_ret(r);

#ifdef SYS_futimesat
	struct timeval *tv = 0;
	if (times) {
		struct timeval tmp[2];
		int i;
		tv = tmp;
		for (i=0; i<2; i++) {
			if (times[i].tv_nsec >= 1000000000U) {
				if (times[i].tv_nsec == UTIME_NOW &&
				    times[1-i].tv_nsec == UTIME_NOW) {
					tv = 0;
					break;
				}
				if (times[i].tv_nsec == UTIME_OMIT)
					return __syscall_ret(-ENOSYS);
				return __syscall_ret(-EINVAL);
			}
			tmp[i].tv_sec = times[i].tv_sec;
			tmp[i].tv_usec = times[i].tv_nsec / 1000;
		}
	}

	r = __syscall(SYS_futimesat, fd, path, tv);
	if (r != -ENOSYS || fd != AT_FDCWD) return __syscall_ret(r);
	r = __syscall(SYS_utimes, path, tv);
#endif

	return __syscall_ret(r);
}
debug log:

solving abc8d74 ...
found abc8d74 in https://inbox.vuxu.org/musl/20140526184036.GZ507@brightrain.aerifal.cx/ ||
	https://inbox.vuxu.org/musl/20140527052625.GC507@brightrain.aerifal.cx/
found 929698b in https://git.vuxu.org/mirror/musl/
preparing index
index prepared:
100644 929698bcc47de1168db21422d66088207a572c9e	src/stat/utimensat.c

applying [1/2] https://inbox.vuxu.org/musl/20140526184036.GZ507@brightrain.aerifal.cx/
diff --git a/src/stat/utimensat.c b/src/stat/utimensat.c
index 929698b..abc8d74 100644

Checking patch src/stat/utimensat.c...
Applied patch src/stat/utimensat.c cleanly.

skipping https://inbox.vuxu.org/musl/20140527052625.GC507@brightrain.aerifal.cx/ for abc8d74
index at:
100644 abc8d743bd1340e82ea996ff3976af8bb18f9dab	src/stat/utimensat.c

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

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).