[or-cvs] dfc caught a SIGXFSZ error when his debugfile reached 2GB.

Roger Dingledine arma at seul.org
Fri Nov 12 04:59:39 UTC 2004


Update of /home/or/cvsroot/src/or
In directory moria.mit.edu:/home2/arma/work/onion/cvs/src/or

Modified Files:
	main.c 
Log Message:
dfc caught a SIGXFSZ error when his debugfile reached 2GB.
so if they exist, catch them and ignore them.
write() will fail normally and we'll look at errno like
normal human beings.


Index: main.c
===================================================================
RCS file: /home/or/cvsroot/src/or/main.c,v
retrieving revision 1.366
retrieving revision 1.367
diff -u -d -r1.366 -r1.367
--- main.c	11 Nov 2004 13:24:10 -0000	1.366
+++ main.c	12 Nov 2004 04:59:37 -0000	1.367
@@ -872,6 +872,10 @@
     case SIGCHLD:
       please_reap_children = 1;
       break;
+#ifdef SIGXFSZ
+    case SIGXFSZ: /* this happens when write fails with etoobig */
+      break; /* ignore; write will fail and we'll look at errno. */
+#endif
     default:
       log(LOG_WARN,"Caught signal %d that we can't handle??", the_signal);
       tor_cleanup();
@@ -983,6 +987,9 @@
   sigaction(SIGPIPE, &action, NULL); /* otherwise sigpipe kills us */
   sigaction(SIGUSR1, &action, NULL); /* dump stats */
   sigaction(SIGHUP,  &action, NULL); /* to reload config, retry conns, etc */
+#ifdef SIGXFSZ
+  sigaction(SIGXFSZ, &action, NULL); /* handle file-too-big resource exhaustion */
+#endif
   if(is_parent)
     sigaction(SIGCHLD, &action, NULL); /* handle dns/cpu workers that exit */
 #endif /* signal stuff */



More information about the tor-commits mailing list