Mercurial > noffle
comparison src/content.c @ 213:f0acb9366e4f noffle
[svn] minor bugfix in Conf_write()
author | mirkol |
---|---|
date | Thu, 22 Nov 2001 12:05:11 +0000 |
parents | 24d4cd032da5 |
children | 411b6ab1acb7 |
comparison
equal
deleted
inserted
replaced
212:21200ce10e68 | 213:f0acb9366e4f |
---|---|
1 /* | 1 /* |
2 content.c | 2 content.c |
3 | 3 |
4 $Id: content.c 316 2001-10-31 11:44:53Z bears $ | 4 $Id: content.c 332 2001-11-22 12:05:11Z mirkol $ |
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 |
196 /* If nowt has changed, do nowt. */ | 196 /* If nowt has changed, do nowt. */ |
197 if ( ! cont.dirty ) | 197 if ( ! cont.dirty ) |
198 return; | 198 return; |
199 | 199 |
200 /* Save the overview to temporary file in same dir. */ | 200 /* Save the overview to temporary file in same dir. */ |
201 /* old tmpfnames will be expired at noffle.c:expireContents() */ | |
201 snprintf( tmpfname, MAXCHAR, "%s/overview/.#%d.%s", | 202 snprintf( tmpfname, MAXCHAR, "%s/overview/.#%d.%s", |
202 Cfg_spoolDir(), (int) getpid(), cont.name ); | 203 Cfg_spoolDir(), (int) getpid(), cont.name ); |
203 if ( ! ( f = fopen( tmpfname, "w" ) ) ) | 204 if ( ! ( f = fopen( tmpfname, "w" ) ) ) |
204 { | 205 { |
205 Log_err( "Could not open %s for writing", tmpfname ); | 206 Log_err( "Could not open %s for writing", tmpfname ); |
258 If empty, remove the overview file and set set first to one | 259 If empty, remove the overview file and set set first to one |
259 beyond last to flag said emptiness. | 260 beyond last to flag said emptiness. |
260 */ | 261 */ |
261 if ( ! anythingWritten ) | 262 if ( ! anythingWritten ) |
262 { | 263 { |
263 if ( unlink( cont.file ) < 0 ) | 264 if ( unlink( tmpfname ) < 0 ) |
264 Log_err( "Unlink of %s failed: %s", cont.file, strerror( errno ) ); | 265 Log_err( "Unlink of %s failed: %s", tmpfname, strerror( errno ) ); |
265 else | 266 else |
266 { | 267 { |
267 cont.dirty = FALSE; | 268 cont.dirty = FALSE; |
268 cont.first = cont.last + 1; | 269 cont.first = cont.last + 1; |
269 } | 270 } |