mainstoreBackup - Support: sr #107340, Fix for uninitialized variable on...


sr #107340: Fix for uninitialized variable on line 216 of storeBackupCheckBackup.

Submitter:  Willard Korfhage <wkorfhage>
Submitted:  Mon 12 Apr 2010 02:35:11 AM UTC
Category:  None Priority:  5 - Normal
Severity:  3 - Normal Status:  Done
Privacy:  Public Assigned to:  None
Open/Closed:  Open Operating System:  None
* Mandatory Fields

Add a New Comment Rich Markup

Mon 12 Apr 2010 02:35:11 AM UTC, original submission:  

In storeBackupCheckBackup, a block begins with "unless ($parJobs)," and this blog figures out how many jobs to run in parallel. This code is Linux specific, and yields an uninitialized value error when run on OpenSolaris because there is no file /proc/cpuinfo for the program to examine. Instead, on Solaris, you need to run psrinfo -v. Here is a new version of the block that can work properly in Solaris, and will at least issue a warning if it doesn't recognize the OS.

unless ($parJobs)
    local *FILE;
    $os = $^O;
    if ($os =~ /linux/)
        if (open(FILE, "/proc/cpuinfo"))
            my $l;
            $parJobs = 1;
            while (<FILE>)
                $parJobs++ if /processor/;
            $parJobs *= 3;
    elsif ($os =~ /solaris/)

        # Look for "virtual processor". This doesn't check if it is online or not.
        my $returncode = `psrinfo -v`;
        my @array = split/\n/.$returncode;
        $parJobs = 1;
        foreach (@array)
            $parJobs++ if /virtual processor/;
        $parJobs *= 3;
        $prLog->print('-kind' => 'W',
              '-str' => ["Can't find # of processors in operating system $os"])
        $parJobs = 1;
    $parJobs = 3 if $parJobs < 3;

Willard Korfhage <wkorfhage>


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by hjclaes (Updated the item)
  • -email is unavailable- added by wkorfhage (Submitted the item)

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.


    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2012-05-31 hjclaes StatusNone Done

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code