Index: doc/aide.1.in =================================================================== RCS file: /cvsroot/aide/aide/doc/aide.1.in,v retrieving revision 1.9 diff -u -r1.9 aide.1.in --- doc/aide.1.in 15 Jul 2006 15:40:49 -0000 1.9 +++ doc/aide.1.in 30 Nov 2006 19:40:57 -0000 @@ -51,6 +51,23 @@ \fBaide\fP prints out its version number .IP "--help,-h" Prints out the standard help message. +.PP +.SH DIAGNOSTICS +Normally, the exit status is 0 if no errors occurred. Except when the +.B --check +command was requested, in which case the exit status is defined as: +.IP "1 * (new files detected?) +" +.IP "2 * (removed files detected?) +" +.IP "4 * (changed files detected?)" +.PP +Additionally, the following exit codes are defined for generic error +conditions: +.IP "14 Error writing error" +.IP "15 Invalid argument error" +.IP "16 Unimplemented function error" +.IP "17 Invalid configureline error" +.IP "18 IO error" +.PP .SH NOTES Please note that due to mmap issues, aide cannot be terminated with SIGTERM. Use SIGKILL to terminate. Index: src/aide.c =================================================================== RCS file: /cvsroot/aide/aide/src/aide.c,v retrieving revision 1.25 diff -u -r1.25 aide.c --- src/aide.c 29 Nov 2006 12:58:02 -0000 1.25 +++ src/aide.c 30 Nov 2006 19:40:58 -0000 @@ -542,7 +542,7 @@ #endif conf->use_initial_errorsto=0; if (!conf->config_check) { - + int exitcode=0; long totalchanges=0; long stat[5]={1,0,0,0,0}; if(conf->action&DO_INIT){ @@ -576,6 +576,7 @@ /* First terse report */ totalchanges=report_tree(conf->tree,0,stat); if(totalchanges>0){ + exitcode=(stat[2]!=0)*1+(stat[3]!=0)*2+(stat[4]!=0)*4; stat[0]=1; report_tree(conf->tree,1,stat); stat[0]=1; @@ -600,8 +601,8 @@ } } - exit(RETOK); - + exit(exitcode); + }else { #ifdef WITH_MHASH if(conf->confmd){