diff src/noffle.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 411b6ab1acb7
children 1ad2602f57db
line wrap: on
line diff
--- a/src/noffle.c	Sun Dec 09 11:32:31 2001 +0000
+++ b/src/noffle.c	Sun Dec 09 12:31:57 2001 +0000
@@ -10,7 +10,7 @@
   received for some seconds (to allow multiple clients connect at the same
   time).
 
-  $Id: noffle.c 337 2001-11-22 22:48:07Z bears $
+  $Id: noffle.c 342 2001-12-09 12:31:57Z bears $
 */
 
 #if HAVE_CONFIG_H
@@ -293,8 +293,8 @@
 		Fetchlist_remove( grp );
 		Grp_setRmtNext( grp, GRP_RMT_NEXT_NOT_SUBSCRIBED );
             }
-            Cont_write();
-            Grp_setFirstLast( grp, Cont_first(), Cont_last() );
+            if ( Cont_write() )
+                Grp_setFirstLast( grp, Cont_first(), Cont_last() );
             Log_inf( "%ld overviews deleted from group %s, %ld left (%ld-%ld)",
                      cntDel, grp, cntLeft, Grp_first( grp ), Grp_last( grp ) );
         }
@@ -380,9 +380,11 @@
 	    if ( toDelete )
 		Db_delete( msgId );
 	}
-	Cont_write();
-	Grp_delete( name );
-	printf( "Group '%s' deleted.\n", name );
+        if ( Cont_write() )
+        {
+            Grp_delete( name );
+            printf( "Group '%s' deleted.\n", name );
+        }
     }
 }