From: Ben Gras Date: Mon, 7 Nov 2005 13:15:09 +0000 (+0000) Subject: "forward compatible" hack for lstat() - make new binaries work on old X-Git-Tag: v3.1.2a~515 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/rndc.conf.html?a=commitdiff_plain;h=c6412ae3423222b00ed4900be75096c94b160f36;p=minix.git "forward compatible" hack for lstat() - make new binaries work on old systems --- diff --git a/lib/posix/_lstat.c b/lib/posix/_lstat.c index bdde67c52..bb2108fe8 100644 --- a/lib/posix/_lstat.c +++ b/lib/posix/_lstat.c @@ -8,9 +8,12 @@ _CONST char *name; struct stat *buffer; { message m; + int r; m.m1_i1 = strlen(name) + 1; m.m1_p1 = (char *) name; m.m1_p2 = (char *) buffer; - return(_syscall(FS, LSTAT, &m)); + if((r = _syscall(FS, LSTAT, &m)) >= 0 || errno != ENOSYS) + return r; + return _stat(name, buffer); }