Author: vitek Date: Tue Jun 24 14:08:08 2008 New Revision: 671344 URL: http://svn.apache.org/viewvc?rev=671344&view=rev Log: 2008-06-24 Travis Vitek <[EMAIL PROTECTED]>
Merge r662707, r662716, r663757, r664036, r664141, r664184 from branches/4.3.x: 2008-06-03 Farid Zaripov <[EMAIL PROTECTED]> Merged r662706 from 4.2.x branch. * tests/src/driver.cpp (_rw_invalid_parameter) [_MSC_VER >= 1400]: New function - invalid parameter handler. (_rw_opt_no_popups) [_MSC_VER >= 1400]: Set _rw_invalid_parameter() as invalid parameter handler to disable invalid parameter CRT popups. 2008-06-03 Farid Zaripov <[EMAIL PROTECTED]> Merged r662715 from 4.2.x branch. * tests/src/file.cpp (rw_nextfd) [_MSC_VER]: Disable expected "Invalid file descriptor" CRT assertions from _commit(). 2008-06-05 Travis Vitek <[EMAIL PROTECTED]> * etc/config/src/RVALUE_REFERENCES.cpp: Add new config test to check for rvalue-reference support. * etc/config/src/VARIADIC_TEMPLATES.cpp: Add new config test to check for variadic template support. 2008-06-06 Travis Vitek <[EMAIL PROTECTED]> * etc/config/RVALUE_REFERENCES.cpp: Fix copyright date. * etc/config/VARIADIC_TEMPLATES.cpp: Ditto. 2008-06-06 Travis Vitek <[EMAIL PROTECTED]> STDCXX-917 * include/type_traits: Add type_traits header that includes integral_contstant<> implementation. * tests/utilities/20.meta.help.cpp: Add new test. 2008-06-06 Travis Vitek <[EMAIL PROTECTED]> Merged revisions 660486, 660489, 660492, 661050, 661053, 661075, and 661152 from branches/4.2.x 2008-05-27 Farid Zaripov <[EMAIL PROTECTED]> * etc/config/src/INFINITY.cpp (flt_qnan): Clear sign bit to obtain value of positive qnan. (dbl_qnan): Ditto. (ldbl_qnan): Ditto. 2008-05-27 Farid Zaripov <[EMAIL PROTECTED]> * include/ansi/cwchar (wcsrchr): Removed const modifier since function returns non-const wchar_t*. 2008-05-27 Farid Zaripov <[EMAIL PROTECTED]> STDCXX-51 * src/num_put.cpp (__rw_fmat_infinite): Enabled processing the sign of the NaN's. Put 'q' or 's' prefix at the beginning of the "{q|s}nan" word. 2008-05-28 Martin Sebor <[EMAIL PROTECTED]> STDCXX-946 * util/exec.cpp (rw_charcasecmp): Folded into... (rw_strcasecmp): ...here. Rewrote a for loop as a do/while loop to silence HP aCC 6 remark #4315-D: for loop without body, did you insert an extra ';'? (get_signo): Corrected the interpretation of exit status of 126 and 127 used to indicate a "cannot execute" and "executable does not exist" errors, respectively. (exec_file): Exit with status of 126 on execv() failure. * util/exec.cpp (calculate_usage, exec_file): Cast literal to the correct type to silence HP aCC 6 warning #2068-D: integer conversion resulted in a change of sign. 2008-05-28 Martin Sebor <[EMAIL PROTECTED]> * util/exec.cpp (ENOENT): Defined macro if not defined in <errno.h>. (exec_file): Exited with status of 127 on ENOENT and 126 otherwise, as per POISIX. Removed unnecessary diagnostic output (handled by the parent instance of the same program). 2008-05-28 Martin Sebor <[EMAIL PROTECTED]> * bin/genxviews (tmpout): New name of a temporary file to replace the final output file with at the end of execution. (output): Used tmpout instead of outfile. Replaced the final output file only at the end of execution of the script. 2008-05-28 Martin Sebor <[EMAIL PROTECTED]> * bin/genxviews (date): Defined at the top of the script to make it accessible throughout. (process_results): Computed and formatted the age of each batch of log files in addition to the timestamp of the oldest one. * bin/xbuildgen (myrev, myurl, myname): Computed constants from the $HeadURL$ Subversion keyword same as in genxviews. (print_help): Added -V option. (resultstyle.css): Added EXEC entry. Passed the version argument to xcomp.awk. * bin/duration (convert_windows_date): New function to convert date in Windows "Day MM/DD/YYYY" format to the POSIX %c format. (convert_ls_date): New function to convert ls-style timestamps to the POSIX %c format. (seconds_from_epoch): Called convert_windows_date or convert_ls_date to convert Windows or ls-style timestamps to the expected POSIX %c format. * bin/xcomp.awk (version): Added a new variable to make it possible to select branches in addition to trunk. Added: stdcxx/trunk/etc/config/src/RVALUE_REFERENCES.cpp - copied, changed from r663757, stdcxx/branches/4.3.x/etc/config/src/RVALUE_REFERENCES.cpp stdcxx/trunk/etc/config/src/VARIADIC_TEMPLATES.cpp - copied, changed from r663757, stdcxx/branches/4.3.x/etc/config/src/VARIADIC_TEMPLATES.cpp stdcxx/trunk/include/type_traits - copied unchanged from r664141, stdcxx/branches/4.3.x/include/type_traits stdcxx/trunk/tests/utilities/20.meta.help.cpp - copied unchanged from r664141, stdcxx/branches/4.3.x/tests/utilities/20.meta.help.cpp Modified: stdcxx/trunk/bin/duration stdcxx/trunk/bin/genxviews stdcxx/trunk/bin/xbuildgen stdcxx/trunk/bin/xcomp.awk stdcxx/trunk/etc/config/src/INFINITY.cpp stdcxx/trunk/include/ansi/cwchar stdcxx/trunk/src/num_put.cpp stdcxx/trunk/util/exec.cpp Modified: stdcxx/trunk/bin/duration URL: http://svn.apache.org/viewvc/stdcxx/trunk/bin/duration?rev=671344&r1=671343&r2=671344&view=diff ============================================================================== --- stdcxx/trunk/bin/duration (original) +++ stdcxx/trunk/bin/duration Tue Jun 24 14:08:08 2008 @@ -194,11 +194,84 @@ } +# converts date in the Windows "Day MM/DD/YYYY" format +# to POSIX %c +convert_windows_date() +{ + date=$1 + + wday=${date%% *} + date=${date#* } + + mon=${date%%/*} + date=${date#*/} + + mday=${date%%/*} + year=${date#*/} + + case $mon in + 01) mon="Jan";; + 02) mon="Feb";; + 03) mon="Mar";; + 04) mon="Apr";; + 05) mon="May";; + 06) mon="Jun";; + 07) mon="Jul";; + 08) mon="Aug";; + 09) mon="Sep";; + 10) mon="Oct";; + 11) mon="Nov";; + 12) mon="Dec";; + esac + + func_return_value="$wday $mon $mday 00:00:00 UTC $year" +} + + +# converts date in the ls -l format to POSIX %c +convert_ls_date() +{ + date=$1 + + mon=${date%% *} + date=${date#* } + + mday=${date%% *} + time=${date#* } + + if [ ${#time} -eq 4 ]; then + year=$time + time="00:00:00" + else + year=`date "+%Y"` + time="$time:00" + fi + + func_return_value="Mon $mon $mday $time UTC $year" +} + + # computes the number of seconds from the Epoch (1/1/1970) seconds_from_epoch() { date=$1 + # remove all leading and trailing whitespace + date=${date## } + date=${date%% } + + datelen=${#date} + + # check the length to see if the date is in the POSIX %c format + if [ $datelen -eq 11 -o $datelen -eq 12 ]; then + # assume ls -l format (i.e., "+%b %e %H:%M" or "+%b %e %Y" + # POSIX date format) + convert_ls_date "$date"; date=$func_return_value + elif [ $datelen -eq 14 ]; then + # assume Day MM/DD/YYYY + convert_windows_date "$date"; date=$func_return_value + fi + # extract the year, the 1-based month and day of month, hours, # minutes, and seconds (normalized to the GMT time zone) from # the date Modified: stdcxx/trunk/bin/genxviews URL: http://svn.apache.org/viewvc/stdcxx/trunk/bin/genxviews?rev=671344&r1=671343&r2=671344&view=diff ============================================================================== --- stdcxx/trunk/bin/genxviews (original) +++ stdcxx/trunk/bin/genxviews Tue Jun 24 14:08:08 2008 @@ -32,6 +32,9 @@ readonly www_stdcxx_dir="/www/stdcxx.apache.org/builds" +# current date and time to compute log ages +readonly now=`date` + XBUILDGEN=`which xbuildgen 2>/dev/null` if [ "$XBUILDGEN" = "" ]; then @@ -73,6 +76,9 @@ o) # argument is the name of output file (stdout by default) outfile=$OPTARG + + # temporary output file (will replace outfile when done) + tmpout=$outfile.$$ ;; V) # specify stdcxx branch/version to generate cross-build @@ -152,16 +158,16 @@ output () { if [ $# -eq 0 ]; then - # no arguments provided, copy its own stdin to outfile - if [ -z $outfile ]; then + # no arguments provided, copy its own stdin to tmpout + if [ -z $tmpout ]; then cat else - cat >>$outfile + cat >>$tmpout fi - elif [ -z $outfile ]; then + elif [ -z $tmpout ]; then echo "$*" else - echo "$*" >>$outfile + echo "$*" >>$tmpout fi } @@ -249,7 +255,8 @@ suffixes="a A d D s S" unset buildlogs - unset oldest + unset oldest_age + unset oldest_time count=0 @@ -289,8 +296,8 @@ else output " <td><a href=\"$xfile\">$xfile</a></td>" - oldest=` cd $logdir && ls -lrt $buildlogs | head -n 1 \ - | awk '{ print $6 " " $7 " " $8 }'` + oldest_time=` cd $logdir && LANG=C ls -lrt $buildlogs | head -n 1 \ + | awk '{ print $6 " " $7 " " $8 }'` if [ $newlogs -gt 0 ]; then @@ -316,12 +323,18 @@ end=`expr $end + 60` fi + # compute the amount of time it took to process this batch duration=`expr $end - $duration` + # compute the age of the oldest log + if [ "$oldest_time" != "" ]; then + oldest_age=`duration "$oldest_time" "$now"` + fi + cat<<EOF | output <td>$count</td> <td>$newlogs</td> - <td>$oldest</td> + <td title="$oldest_time">$oldest_age</td> <td>$duration</td> </tr> EOF @@ -634,7 +647,6 @@ # compute the number of seconds it took to process all logs -readonly now=`date` processing_time=`duration "$start_time" "$now"` cat<<EOF | output @@ -644,3 +656,9 @@ </body> </html> EOF + +# rerame the temporary output file to $outfile, possibly replacing +# the original $outfile if it exists +if [ -f "$tmpout" ]; then + mv $tmpout $outfile +fi Modified: stdcxx/trunk/bin/xbuildgen URL: http://svn.apache.org/viewvc/stdcxx/trunk/bin/xbuildgen?rev=671344&r1=671343&r2=671344&view=diff ============================================================================== --- stdcxx/trunk/bin/xbuildgen (original) +++ stdcxx/trunk/bin/xbuildgen Tue Jun 24 14:08:08 2008 @@ -83,9 +83,6 @@ ###################################################################### # global constants -# set program name (used in diagnostic messages) -readonly myname=`basename $0` - # the directory where the script is located to get a hold of other # files at locations relative to this one (assumes the script resides # within the stdcxx source tree) @@ -121,14 +118,24 @@ # default page title (unless overridden on the command line) title="Multi-platform Test Result View" -# script's revision number +# extract the script's revision number myrev='$Revision$' -myrev=${myrev#'$Revision: '} -myrev=${myrev%' $'} +myrev=${myrev#'$Revision: '} # strip leading text +myrev=${myrev%' $'} # strip trailing text + +# form the URL to this version of the script in the repository +myurl='$HeadURL$' +myurl=${myurl#'$HeadURL: '} # strip leading text +myurl=${myurl##*asf/} # strip svn prefix +myurl=${myurl%' $'} # strip trailing text -# URL to this version of the script in the repository -readonly myurl="$svnpath/bin/xbuildgen?view=markup&rev=$myrev" +# prepend ViewVC prefix +myurl="http://svn.apache.org/viewvc/$myurl" +# extract program name from the url (used in diagnostic messages) +readonly myname=${myurl##*/} + +myurl="$myurl?view=markup&rev=$myrev" ###################################################################### @@ -175,6 +182,10 @@ echo " -t <list-of-tests>" echo " Generate a report for the specified list of tests with" echo " tests listed in columns and builds in rows." + echo + echo " -V <version>" + echo " Stdcxx version (branch) to generate results for." + echo " When omitted, trunk is assumed." } ###################################################################### @@ -839,6 +850,12 @@ font-weight:bold; text-align:center; } +td.EXEC { + color:white; + background:mediumslateblue; + font-weight:bold; + text-align:center; +} td.xdep { color:yellow; background:gray; @@ -947,7 +964,7 @@ xfails="" fi -$xcomp bodyonly=1 logdir=$logdir $xfails $textlogs | output +$xcomp bodyonly=1 logdir=$logdir version=$version $xfails $textlogs | output ###################################################################### # output the rest of the HTML file @@ -1040,6 +1057,15 @@ </td> </tr> <tr> + <td class="EXEC">EXEC</td> + <td class="na">Failure</td> + <td colspan=2 class="na"><center>Not Applicable</center></td> + <td class="na"> + Component compiled and linked successfully but failed + to execute (possibly due to a linker error). + </td> + </tr> + <tr> <td class="WARN">WARN</td> <td class="na">Success</td> <td class="XWARN">XWARN</td> Modified: stdcxx/trunk/bin/xcomp.awk URL: http://svn.apache.org/viewvc/stdcxx/trunk/bin/xcomp.awk?rev=671344&r1=671343&r2=671344&view=diff ============================================================================== --- stdcxx/trunk/bin/xcomp.awk (original) +++ stdcxx/trunk/bin/xcomp.awk Tue Jun 24 14:08:08 2008 @@ -23,10 +23,12 @@ ######################################################################## # # SYNOPSIS -# myname [bodyonly=0|1 logdir=<logdir>] logs... +# myname [bodyonly=0|1 logdir=<logdir> version=<version>] logs... # # VARIABLES: # bodyonly when non-zero, suppresses the <html> tags +# logdir +# version stdcxx version (branch) to generate results for. # ######################################################################## @@ -132,8 +134,6 @@ buildmodes ["15s"] = "archive, debug, reentrant" buildmodes ["15S"] = "archive, debug, reentrant, wide" - svnpath="http://svn.apache.org/viewvc/stdcxx/trunk" - # regular expression to match a name (e.g., compiler or OS) re_name = "[A-Za-z][A-Za-z_0-9]*" @@ -165,6 +165,18 @@ # detect the type of file 1 == FNR { + + if (svnpath == "") { + + # initialize svnpath using version (assume trunk by default) + svnpath = "http://svn.apache.org/viewvc/stdcxx" + + if (version == "" || version == "trunk") + svnpath = svnpath "/trunk" + else + svnpath = svnpath "/branches/" version + } + section = 0 if (0 == match(FILENAME, re_logname)) { Modified: stdcxx/trunk/etc/config/src/INFINITY.cpp URL: http://svn.apache.org/viewvc/stdcxx/trunk/etc/config/src/INFINITY.cpp?rev=671344&r1=671343&r2=671344&view=diff ============================================================================== --- stdcxx/trunk/etc/config/src/INFINITY.cpp (original) +++ stdcxx/trunk/etc/config/src/INFINITY.cpp Tue Jun 24 14:08:08 2008 @@ -165,6 +165,15 @@ val.val /= flt_zero (); + // val.val can be +qnan or -qnan + // clear sign bit + if (e == big_endian) { + val.bits [0] &= '\x7f'; + } + else { + val.bits [sizeof (val.val) - 1] &= '\x7f'; + } + #else // if !defined (_RWSTD_NO_DBL_TRAPS) // floating point arithmetic traps @@ -172,7 +181,7 @@ // assume IEEE 754 floating point format if (e == big_endian) { - val.bits [0] = '\xff'; + val.bits [0] = '\x7f'; val.bits [1] = '\xc0'; val.bits [2] = '\0'; val.bits [3] = '\0'; @@ -181,7 +190,7 @@ val.bits [0] = '\0'; val.bits [1] = '\0'; val.bits [2] = '\xc0'; - val.bits [3] = '\xff'; + val.bits [3] = '\x7f'; } #endif // _RWSTD_NO_DBL_TRAPS @@ -355,6 +364,15 @@ val.val /= dbl_zero (); + // val.val can be +qnan or -qnan + // clear sign bit + if (e == big_endian) { + val.bits [0] &= '\x7f'; + } + else { + val.bits [sizeof (val.val) - 1] &= '\x7f'; + } + #else // if !defined (_RWSTD_NO_DBL_TRAPS) // floating point arithmetic traps @@ -362,7 +380,7 @@ // assume IEEE 754 floating point format if (e == big_endian) { - val.bits [0] = '\xff'; + val.bits [0] = '\x7f'; val.bits [1] = '\xf8'; val.bits [2] = '\0'; val.bits [3] = '\0'; @@ -379,7 +397,7 @@ val.bits [4] = '\0'; val.bits [5] = '\0'; val.bits [6] = '\xf8'; - val.bits [7] = '\xff'; + val.bits [7] = '\x7f'; } #endif // _RWSTD_NO_DBL_TRAPS @@ -587,6 +605,18 @@ val.val /= ldbl_zero (); + // val.val can be +qnan or -qnan + // clear sign bit + if (e == big_endian) { + val.bits [0] &= '\x7f'; + } + else { + unsigned inx = sizeof (val.val) - 1; + // skip the trailing zero's + while (!val.bits [inx]) --inx; + val.bits [inx] &= '\x7f'; + } + #else // if !defined (_RWSTD_NO_DBL_TRAPS) // floating point arithmetic traps @@ -594,7 +624,7 @@ // assume IEEE 754 floating point format if (e == big_endian) { - val.bits [ 0] = '\xff'; + val.bits [ 0] = '\x7f'; val.bits [ 1] = '\xff'; val.bits [ 2] = '\x80'; val.bits [ 3] = '\0'; @@ -627,7 +657,7 @@ val.bits [12] = '\0'; val.bits [13] = '\x80'; val.bits [14] = '\xff'; - val.bits [15] = '\xff'; + val.bits [15] = '\x7f'; } #endif // _RWSTD_NO_DBL_TRAPS Copied: stdcxx/trunk/etc/config/src/RVALUE_REFERENCES.cpp (from r663757, stdcxx/branches/4.3.x/etc/config/src/RVALUE_REFERENCES.cpp) URL: http://svn.apache.org/viewvc/stdcxx/trunk/etc/config/src/RVALUE_REFERENCES.cpp?p2=stdcxx/trunk/etc/config/src/RVALUE_REFERENCES.cpp&p1=stdcxx/branches/4.3.x/etc/config/src/RVALUE_REFERENCES.cpp&r1=663757&r2=671344&rev=671344&view=diff ============================================================================== --- stdcxx/branches/4.3.x/etc/config/src/RVALUE_REFERENCES.cpp (original) +++ stdcxx/trunk/etc/config/src/RVALUE_REFERENCES.cpp Tue Jun 24 14:08:08 2008 @@ -18,7 +18,7 @@ * implied. See the License for the specific language governing * permissions and limitations under the License. * - * Copyright 1999-2008 Rogue Wave Software, Inc. + * Copyright 2008 Rogue Wave Software, Inc. * **************************************************************************/ Copied: stdcxx/trunk/etc/config/src/VARIADIC_TEMPLATES.cpp (from r663757, stdcxx/branches/4.3.x/etc/config/src/VARIADIC_TEMPLATES.cpp) URL: http://svn.apache.org/viewvc/stdcxx/trunk/etc/config/src/VARIADIC_TEMPLATES.cpp?p2=stdcxx/trunk/etc/config/src/VARIADIC_TEMPLATES.cpp&p1=stdcxx/branches/4.3.x/etc/config/src/VARIADIC_TEMPLATES.cpp&r1=663757&r2=671344&rev=671344&view=diff ============================================================================== --- stdcxx/branches/4.3.x/etc/config/src/VARIADIC_TEMPLATES.cpp (original) +++ stdcxx/trunk/etc/config/src/VARIADIC_TEMPLATES.cpp Tue Jun 24 14:08:08 2008 @@ -18,7 +18,7 @@ * implied. See the License for the specific language governing * permissions and limitations under the License. * - * Copyright 1999-2008 Rogue Wave Software, Inc. + * Copyright 2008 Rogue Wave Software, Inc. * **************************************************************************/ Modified: stdcxx/trunk/include/ansi/cwchar URL: http://svn.apache.org/viewvc/stdcxx/trunk/include/ansi/cwchar?rev=671344&r1=671343&r2=671344&view=diff ============================================================================== --- stdcxx/trunk/include/ansi/cwchar (original) +++ stdcxx/trunk/include/ansi/cwchar Tue Jun 24 14:08:08 2008 @@ -722,7 +722,7 @@ namespace std { -using wcscspn; +using ::wcscspn; # undef _RWSTD_NO_WCSCSPN #endif // _RWSTD_NO_WCSCSPN @@ -940,7 +940,7 @@ inline wchar_t* wcsrchr (wchar_t *__s, wchar_t __c) { - const wchar_t *__ss = __s; + wchar_t *__ss = __s; while (*__ss++); while (--__ss != __s && *__ss != __c); return *__ss == __c ? __ss : 0; Modified: stdcxx/trunk/src/num_put.cpp URL: http://svn.apache.org/viewvc/stdcxx/trunk/src/num_put.cpp?rev=671344&r1=671343&r2=671344&view=diff ============================================================================== --- stdcxx/trunk/src/num_put.cpp (original) +++ stdcxx/trunk/src/num_put.cpp Tue Jun 24 14:08:08 2008 @@ -100,28 +100,24 @@ } else { _RWSTD_ASSERT (__rw_isnan (val)); -#if 0 - // disabled since not all platforms correctly handling sign of NaN's + if (__rw_signbit (val)) { *end++ = '-'; } else if (flags & _RWSTD_IOS_SHOWPOS) { *end++ = '+'; } -#endif const char str [] = "nNaAqQsS"; - *end++ = str [cap + 0]; - *end++ = str [cap + 2]; - *end++ = str [cap + 0]; -#if 0 - // disabled since not all platforms supporting - // the quiet and signaling NaN's + if (__rw_isqnan (val)) *end++ = str [cap + 4]; else if (__rw_issnan (val)) *end++ = str [cap + 6]; -#endif + + *end++ = str [cap + 0]; + *end++ = str [cap + 2]; + *end++ = str [cap + 0]; } return int (end - buf); Modified: stdcxx/trunk/util/exec.cpp URL: http://svn.apache.org/viewvc/stdcxx/trunk/util/exec.cpp?rev=671344&r1=671343&r2=671344&view=diff ============================================================================== --- stdcxx/trunk/util/exec.cpp (original) +++ stdcxx/trunk/util/exec.cpp Tue Jun 24 14:08:08 2008 @@ -89,6 +89,9 @@ #endif +#ifndef ENOENT +# define ENOENT 1 /* Linux value */ +#endif #ifndef ESRCH # define ESRCH 3 /* Linux value */ #endif @@ -329,22 +332,6 @@ }; /** - Compare two characters in a case-insensitive manner - - @param c1 first character to compare - @param c2 second character to compare - @return an integer less than, equal to, or greater than 0, coresponding - to whether c1 is less than, equal to, or greater than c2 when compared - in a case insensitive manner. -*/ -static int -rw_charcasecmp (char c1, char c2) -{ - typedef unsigned char UChar; - return tolower ((UChar)c1) - tolower ((UChar)c2); -} - -/** Reimplementation of the POSIX strcasecmp function. This is a simplistic (re)implementation of the strcasecmp function @@ -361,15 +348,19 @@ { int delta; + typedef unsigned char UChar; + assert (0 != s1); assert (0 != s2); - for (delta = rw_charcasecmp (*s1, *s2); - *s1 && *s2 && 0 == delta; - delta = rw_charcasecmp (*(++s1), *(++s2))); + do { + delta = tolower ((UChar)*s1) - tolower ((UChar)*s2); + } while (*s1++ && *s2++ && 0 == delta); + return delta; } + int get_signo (const char* signame) { @@ -529,12 +520,21 @@ if (child_pid == wait_pid) { if (WIFEXITED (status)) { result->exit = WEXITSTATUS (status); + + /* from POSIX, 2.8.2 Exit Status for Commands: + * + * If a command is not found, the exit status shall be 127. + * If the command name is found, but it is not an executable + * utility, the exit status shall be 126. Applications that + * invoke utilities without using the shell should use these + * exit status values to report similar errors. + */ switch (result->exit) { case 126: - result->status = ST_EXIST; + result->status = ST_EXECUTE; break; case 127: - result->status = ST_EXECUTE; + result->status = ST_EXIST; break; } break; /*we've got an exit state, so let's bail*/ @@ -791,7 +791,7 @@ c_clk = times (&c_tms); - if (-1 == c_clk) { + if ((clock_t)-1 == c_clk) { warn ("Failed to retrieve ending times: %s", strerror (errno)); return; } @@ -869,10 +869,13 @@ execv (options->argv [0], options->argv); - fprintf (error_file, "%s (%s): execv (\"%s\", ...) error: %s\n", - exe_name, target_name, options->argv [0], strerror (errno)); + /* POSIX specifies status of 127 when the executable doesn't + * exist and 126 for all other exec failures + */ + if (ENOENT == errno) + exit (127); - exit (1); + exit (126); } if (-1 == child_pid) { @@ -885,7 +888,7 @@ struct tms h_tms; clock_t h_clk = times (&h_tms); wait_for_child (child_pid, options->timeout, result); - if (-1 != h_clk) + if ((clock_t)-1 != h_clk) calculate_usage (result, h_clk, &h_tms); else warn ("Failed to retrieve start times: %s", strerror (errno));