aboutsummaryrefslogtreecommitdiff
path: root/src/os/unix
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2006-08-30 10:39:17 +0000
committerIgor Sysoev <igor@sysoev.ru>2006-08-30 10:39:17 +0000
commitda173abde0afa26b02c778d6475462ed487594c5 (patch)
tree25362ec56c889a2284e6feb341d5b87f13b5beab /src/os/unix
parent9cdd8a1cbcf70527db51eeab707a5bc05babdcf3 (diff)
downloadnginx-release-0.4.0.tar.gz
nginx-release-0.4.0.zip
nginx-0.4.0-RELEASE importrelease-0.4.0
*) Change in internal API: the HTTP modules initialization was moved from the init module phase to the HTTP postconfiguration phase. *) Change: now the request body is not read beforehand for the ngx_http_perl_module: it's required to start the reading using the $r->has_request_body method. *) Feature: the ngx_http_perl_module supports the DECLINED return code. *) Feature: the ngx_http_dav_module supports the incoming "Date" header line for the PUT method. *) Feature: the "ssi" directive is available inside the "if" block. *) Bugfix: a segmentation fault occurred if there was an "index" directive with variables and the first index name was without variables; the bug had appeared in 0.1.29.
Diffstat (limited to 'src/os/unix')
-rw-r--r--src/os/unix/ngx_files.c18
-rw-r--r--src/os/unix/ngx_files.h8
2 files changed, 24 insertions, 2 deletions
diff --git a/src/os/unix/ngx_files.c b/src/os/unix/ngx_files.c
index 575831390..1801045ab 100644
--- a/src/os/unix/ngx_files.c
+++ b/src/os/unix/ngx_files.c
@@ -221,6 +221,24 @@ ngx_write_chain_to_file(ngx_file_t *file, ngx_chain_t *cl, off_t offset,
ngx_int_t
+ngx_set_file_time(u_char *name, ngx_fd_t fd, time_t s)
+{
+ struct timeval tv[2];
+
+ tv[0].tv_sec = s;
+ tv[0].tv_usec = 0;
+ tv[1].tv_sec = s;
+ tv[1].tv_usec = 0;
+
+ if (utimes((char *) name, tv) != -1) {
+ return NGX_OK;
+ }
+
+ return NGX_ERROR;
+}
+
+
+ngx_int_t
ngx_open_dir(ngx_str_t *name, ngx_dir_t *dir)
{
dir->dir = opendir((const char *) name->data);
diff --git a/src/os/unix/ngx_files.h b/src/os/unix/ngx_files.h
index dffef52a5..ff2515699 100644
--- a/src/os/unix/ngx_files.h
+++ b/src/os/unix/ngx_files.h
@@ -58,11 +58,15 @@ ssize_t ngx_write_chain_to_file(ngx_file_t *file, ngx_chain_t *ce,
#define ngx_rename_file(o, n) rename((const char *) o, (const char *) n)
-#define ngx_rename_file_n "rename"
+#define ngx_rename_file_n "rename()"
#define ngx_change_file_access(n, a) chmod((const char *) n, a)
-#define ngx_change_file_access_n "chmod"
+#define ngx_change_file_access_n "chmod()"
+
+
+ngx_int_t ngx_set_file_time(u_char *name, ngx_fd_t fd, time_t s);
+#define ngx_set_file_time_n "utimes()"
#define ngx_file_info(file, sb) stat((const char *) file, sb)