diff options
| -rw-r--r-- | data.c | 6 |
1 files changed, 6 insertions, 0 deletions
| @@ -388,6 +388,12 @@ int object_add(const char *id, d_char *obj) | |||
| 388 | xs *fn = _object_fn(id); | 388 | xs *fn = _object_fn(id); |
| 389 | FILE *f; | 389 | FILE *f; |
| 390 | 390 | ||
| 391 | if (mtime(fn) > 0.0) { | ||
| 392 | /* object already here */ | ||
| 393 | srv_debug(0, xs_fmt("object_add object already here %s", id)); | ||
| 394 | return 204; /* No content */ | ||
| 395 | } | ||
| 396 | |||
| 391 | if ((f = fopen(fn, "w")) != NULL) { | 397 | if ((f = fopen(fn, "w")) != NULL) { |
| 392 | flock(fileno(f), LOCK_EX); | 398 | flock(fileno(f), LOCK_EX); |
| 393 | 399 | ||