logo       

nagios/xdata xsddefault.c,1.1.1.1,1.1.1.1.2.1: msg#00012

Subject: nagios/xdata xsddefault.c,1.1.1.1,1.1.1.1.2.1
Update of /cvsroot/nagios/nagios/xdata
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17365/xdata

Modified Files:
      Tag: nagios-1-x-bugfixes
        xsddefault.c 
Log Message:
Check for full partition when saving status file

Index: xsddefault.c
===================================================================
RCS file: /cvsroot/nagios/nagios/xdata/xsddefault.c,v
retrieving revision 1.1.1.1
retrieving revision 1.1.1.1.2.1
diff -C2 -d -r1.1.1.1 -r1.1.1.1.2.1
*** xsddefault.c        26 Feb 2002 04:04:11 -0000      1.1.1.1
--- xsddefault.c        13 Dec 2005 00:46:15 -0000      1.1.1.1.2.1
***************
*** 3,8 ****
   * XSDDEFAULT.C - Default external status data input routines for Nagios
   *
!  * Copyright (c) 2000-2001 Ethan Galstad (nagios@xxxxxxxxxx)
!  * Last Modified:   11-29-2001
   *
   * License:
--- 3,8 ----
   * XSDDEFAULT.C - Default external status data input routines for Nagios
   *
!  * Copyright (c) 2000-2005 Ethan Galstad (nagios@xxxxxxxxxx)
!  * Last Modified:   12-12-2005
   *
   * License:
***************
*** 209,222 ****
  int xsddefault_begin_aggregated_dump(void){
        char buffer[MAX_INPUT_BUFFER];
  
        /* open a safe temp file for output */
        
snprintf(xsddefault_aggregate_temp_file,sizeof(xsddefault_aggregate_temp_file)-1,"%sXXXXXX",xsddefault_temp_file);
        
xsddefault_aggregate_temp_file[sizeof(xsddefault_aggregate_temp_file)-1]='\x0';
!       
if((xsddefault_aggregate_fd=mkstemp(xsddefault_aggregate_temp_file))==-1)
                return ERROR;
        xsddefault_aggregate_fp=fdopen(xsddefault_aggregate_fd,"w");
        if(xsddefault_aggregate_fp==NULL){
                close(xsddefault_aggregate_fd);
                unlink(xsddefault_aggregate_temp_file);
                return ERROR;
                }
--- 209,232 ----
  int xsddefault_begin_aggregated_dump(void){
        char buffer[MAX_INPUT_BUFFER];
+       char temp_buffer[MAX_INPUT_BUFFER];
  
        /* open a safe temp file for output */
        
snprintf(xsddefault_aggregate_temp_file,sizeof(xsddefault_aggregate_temp_file)-1,"%sXXXXXX",xsddefault_temp_file);
        
xsddefault_aggregate_temp_file[sizeof(xsddefault_aggregate_temp_file)-1]='\x0';
!       
if((xsddefault_aggregate_fd=mkstemp(xsddefault_aggregate_temp_file))==-1){
!               /* log an error */
!               snprintf(temp_buffer,sizeof(temp_buffer),"Error: Unable to 
create temp file for writing status data!\n");
!               temp_buffer[sizeof(temp_buffer)-1]='\x0';
!               write_to_logs_and_console(temp_buffer,NSLOG_RUNTIME_ERROR,TRUE);
                return ERROR;
+               }
        xsddefault_aggregate_fp=fdopen(xsddefault_aggregate_fd,"w");
        if(xsddefault_aggregate_fp==NULL){
                close(xsddefault_aggregate_fd);
                unlink(xsddefault_aggregate_temp_file);
+               /* log an error */
+               snprintf(temp_buffer,sizeof(temp_buffer),"Error: Unable to open 
temp file '%s' for writing status data!\n",xsddefault_aggregate_temp_file);
+               temp_buffer[sizeof(temp_buffer)-1]='\x0';
+               write_to_logs_and_console(temp_buffer,NSLOG_RUNTIME_ERROR,TRUE);
                return ERROR;
                }
***************
*** 233,236 ****
--- 243,247 ----
  /* finish aggregated dump */
  int xsddefault_end_aggregated_dump(void){
+       char temp_buffer[MAX_INPUT_BUFFER];
  
        /* reset file permissions */
***************
*** 242,247 ****
  
        /* move the temp file to the status log (overwrite the old status log) 
*/
!       if(my_rename(xsddefault_aggregate_temp_file,xsddefault_status_log))
                return ERROR;
  
        return OK;
--- 253,263 ----
  
        /* move the temp file to the status log (overwrite the old status log) 
*/
!       if(my_rename(xsddefault_aggregate_temp_file,xsddefault_status_log)){
!               /* log an error */
!               snprintf(temp_buffer,sizeof(temp_buffer),"Error: Unable to 
update status data file '%s'!\n",xsddefault_status_log);
!               temp_buffer[sizeof(temp_buffer)-1]='\x0';
!               write_to_logs_and_console(temp_buffer,NSLOG_RUNTIME_ERROR,TRUE);
                return ERROR;
+               }
  
        return OK;



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
linux.arklinux....    user-groups.lin...    kde.usability/2...    ietf.ipp/2002-0...    mail.spam.spamc...    os.netbsd.devel...    audio.cd-record...    text.unicode.de...    php.documentati...    games.fps.halfl...    window-managers...    suse.oracle.gen...    bug-tracking.gn...    video.dvdrip.us...    xfree86.cvs/200...    java.netbeans.m...    network.argus/2...    culture.sf.kill...    debian.ports.al...    freebsd.questio...    qplus.devel/200...    handhelds.palm....   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe