diff options
author | citats <citats@f38db490-d61c-443f-a65b-d21fe96a405b> | 2004-04-05 02:47:48 +0000 |
---|---|---|
committer | citats <citats@f38db490-d61c-443f-a65b-d21fe96a405b> | 2004-04-05 02:47:48 +0000 |
commit | b666bb9b703cdeb8ce5b2e6baa633cf2ed50fe6f (patch) | |
tree | 6c8800ce054810ef7dedb10047e0f75f8a337324 /pbx | |
parent | f7f4c6535bb013d24df6c7b8feeb1f9201ebabbd (diff) |
Only update utime in pbx_spool.c if the file exists
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@2621 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'pbx')
-rwxr-xr-x | pbx/pbx_spool.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/pbx/pbx_spool.c b/pbx/pbx_spool.c index 5a814b8d9..946f369c3 100755 --- a/pbx/pbx_spool.c +++ b/pbx/pbx_spool.c @@ -203,12 +203,12 @@ static void safe_append(struct outgoing *o, time_t now, char *s) fclose(f); } else close(fd); + /* Update the file time */ + tbuf.actime = now; + tbuf.modtime = now + o->retrytime; + if (utime(o->fn, &tbuf)) + ast_log(LOG_WARNING, "Unable to set utime on %s: %s\n", o->fn, strerror(errno)); } - /* Update the file time */ - tbuf.actime = now; - tbuf.modtime = now + o->retrytime; - if (utime(o->fn, &tbuf)) - ast_log(LOG_WARNING, "Unable to set utime on %s: %s\n", o->fn, strerror(errno)); } static void *attempt_thread(void *data) @@ -258,7 +258,6 @@ static void launch_service(struct outgoing *o) static int scan_service(char *fn, time_t now, time_t atime) { struct outgoing *o; - struct utimbuf tbuf; FILE *f; o = malloc(sizeof(struct outgoing)); if (o) { |