Mercurial > noffle
comparison src/util.c @ 223:ffb1848a39db noffle
[svn] * src/util.c: Improve (correct) error detection when updating
timestamp file.
* src/content.h, src/content.c: Return Boolean success/fail from
Cont_write. Also ensure cont.first isn't polluted in the event
of a failed update.
* src/client.c,src/control.c,src/fetch.c,src/noffle.c,src/post.c,
src/pseudo.c: If Cont_write fails, don't do actions that need it to
have worked. Typically, don't update first and last article numbers
in group database.
* src/server.c: If groupinfo.lastupdate is unreadable or corrupt,
spot this and report it and give an explicit error when processing
NNTP NEWGROUPS command.
| author | bears |
|---|---|
| date | Sun, 09 Dec 2001 12:31:57 +0000 |
| parents | eb2589384836 |
| children | fbff73fe5b40 |
comparison
equal
deleted
inserted
replaced
| 222:bf290632d29e | 223:ffb1848a39db |
|---|---|
| 1 /* | 1 /* |
| 2 util.c | 2 util.c |
| 3 | 3 |
| 4 $Id: util.c 325 2001-11-14 10:56:42Z bears $ | 4 $Id: util.c 342 2001-12-09 12:31:57Z bears $ |
| 5 */ | 5 */ |
| 6 | 6 |
| 7 #if HAVE_CONFIG_H | 7 #if HAVE_CONFIG_H |
| 8 #include <config.h> | 8 #include <config.h> |
| 9 #endif | 9 #endif |
| 253 Log_err( "Could not open %s for writing (%s)", | 253 Log_err( "Could not open %s for writing (%s)", |
| 254 tmpfname, strerror( errno ) ); | 254 tmpfname, strerror( errno ) ); |
| 255 return; | 255 return; |
| 256 } | 256 } |
| 257 fprintf( f, "%lu\n", t ); | 257 fprintf( f, "%lu\n", t ); |
| 258 fclose( f ); | 258 if ( fclose( f ) != 0 ) |
| 259 if ( ferror( f ) ) | |
| 260 { | 259 { |
| 261 Log_err( "Error stamping into file %s: %s", | 260 Log_err( "Error stamping into file %s: %s", |
| 262 tmpfname, strerror( errno ) ); | 261 tmpfname, strerror( errno ) ); |
| 263 | 262 |
| 264 } | 263 } |
