~ubuntu-branches/ubuntu/maverick/atop/maverick-updates

« back to all changes in this revision

Viewing changes to rawlog.c

  • Committer: Package Import Robot
  • Author(s): Tyler Hicks
  • Date: 2012-02-10 13:01:13 UTC
  • mfrom: (3.1.3 squeeze)
  • Revision ID: package-import@ubuntu.com-20120210130113-2nyao2r2aa5z08qo
Tags: 1.23-1+squeeze1build0.10.10.1
fake sync from Debian

Show diffs side-by-side

added added

removed removed

Lines of Context:
477
477
                */
478
478
                fprintf(stderr, "Decompressing logfile ....\n");
479
479
 
480
 
                snprintf(tmpname2, sizeof tmpname2, "/tmp/atopwrk%d", getpid());
 
480
                snprintf(tmpname2, sizeof tmpname2, "/tmp/atopwrkXXXXXX");
 
481
 
 
482
                if ( (rawfd = mkstemp(tmpname2)) == -1)
 
483
                {
 
484
                        fprintf(stderr, "%s - ", rawname);
 
485
                        perror("open decompressed raw file");
 
486
                        cleanstop(7);
 
487
                }
 
488
 
481
489
                snprintf(command,  sizeof command, "gunzip -c %s > %s",
482
490
                                                        tmpname1, tmpname2);
483
491
                system (command);
484
 
 
485
 
                if ( (rawfd = open(tmpname2, O_RDONLY)) == -1)
486
 
                {
487
 
                        fprintf(stderr, "%s - ", rawname);
488
 
                        perror("open decompressed raw file");
489
 
                        cleanstop(7);
490
 
                }
491
 
 
492
492
                unlink(tmpname2);
493
493
        }
494
494