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 {
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php