version 1.93, 2006/04/06 10:13:00 |
version 1.94, 2006/04/07 12:54:40 |
|
|
* rcs_set_mtime() |
* rcs_set_mtime() |
* |
* |
* Set <filename> last modified time to <mtime> if it's not set to -1. |
* Set <filename> last modified time to <mtime> if it's not set to -1. |
* Returns 0 on success, or -1 on failure. |
|
*/ |
*/ |
int |
void |
rcs_set_mtime(const char *filename, time_t mtime) |
rcs_set_mtime(const char *filename, time_t mtime) |
{ |
{ |
static struct timeval tv[2]; |
static struct timeval tv[2]; |
|
|
if (mtime == -1) |
if (mtime == -1) |
return (0); |
return; |
|
|
tv[0].tv_sec = mtime; |
tv[0].tv_sec = mtime; |
tv[1].tv_sec = tv[0].tv_sec; |
tv[1].tv_sec = tv[0].tv_sec; |
|
|
if (utimes(filename, tv) == -1) { |
if (utimes(filename, tv) == -1) |
cvs_log(LP_ERRNO, "error setting utimes"); |
fatal("error setting utimes: %s", strerror(errno)); |
return (-1); |
|
} |
|
|
|
return (0); |
|
} |
} |
|
|
int |
int |