cvs: php4 /ext/standard filestat.c

From: Date: Tue, 01 Oct 2002 21:53:25 +0000
Subject: cvs: php4 /ext/standard filestat.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-14385@lists.php.net to get a copy of this message
sesser Tue Oct 1 17:53:25 2002 EDT Modified files: /php4/ext/standard filestat.c Log: repairing the chaos utime("filename", NULL) is not only valid but a MUST on linux if you are not the owner... Index: php4/ext/standard/filestat.c diff -u php4/ext/standard/filestat.c:1.110 php4/ext/standard/filestat.c:1.111 --- php4/ext/standard/filestat.c:1.110 Mon Sep 23 10:59:24 2002 +++ php4/ext/standard/filestat.c Tue Oct 1 17:53:25 2002 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: filestat.c,v 1.110 2002/09/23 14:59:24 sas Exp $ */ +/* $Id: filestat.c,v 1.111 2002/10/01 21:53:25 sesser Exp $ */ #include "php.h" #include "safe_mode.h" @@ -484,16 +484,20 @@ struct utimbuf *newtime = NULL; int ac = ZEND_NUM_ARGS(); - newtime = &newtimebuf; if (ac == 1 && zend_get_parameters_ex(1, &filename) != FAILURE) { +#ifndef HAVE_UTIME_NULL + newtime = &newtimebuf; newtime->modtime = newtime->actime = time(NULL); +#endif } else if (ac == 2 && zend_get_parameters_ex(2, &filename, &filetime) != FAILURE) { convert_to_long_ex(filetime); + newtime = &newtimebuf; newtime->modtime = newtime->actime = Z_LVAL_PP(filetime); } else if (ac == 3 && zend_get_parameters_ex(3, &filename, &filetime, &fileatime) != FAILURE) { convert_to_long_ex(fileatime); convert_to_long_ex(filetime); + newtime = &newtimebuf; newtime->actime = Z_LVAL_PP(fileatime); newtime->modtime = Z_LVAL_PP(filetime); } else {

« previous php.cvs (#14385) next »