to the fact that the /bin/sh set command always sets the exit status to
0, so testing $? will not help discover if getopt found an error if
getopt is used via "set -- `getopt ....`". (POSIX 1003.2 D11 draft says
that the sh set command must return 0 as the exit status.)
I think that POSIX is wrong or that is is not well enough specified to
allow the result of the set to be the exit status of the getopt. But
considering the sequential nature of execution, the set is done last
and is the "last command" and therefore must be the one to set the exit
status. At least there is a work-around for shell scripts.
From Olaf Seibert <rhialto@polder.ubc.kun.nl> (PR 3687)
* Make an attempt to check the maximum filesize before attempting
a write to the server, as write RPCs will typically happen
asynchronously, and the process will not see the error.
Fixes problems with unexpectly truncated files at 4G
* Pass up errors in nfs_writerpc correctly
of these functions. This is somewhat of a kludge, but there is not
much else we can do for this case.
Because of how the callable versions are created, by CPP trickery
and inclusion of another .c file, we cannot allow the included .c
file to pull in "namespace.h", since it undoes the CPP trickery we
have performed. Introduce a CPP macro that prevents the included .c
file from pulling in "namespace.h".
get APM debugging code compiled in. also, redo the way APM debugging
printfs are invoked, making sure they're always compiled in if debugging
is enabled, but printing them only if the appropriate bits in the
'apmdebug' global variable are set.
* clean up function prototypes (alphabetize in each category, get rid
of 'STATIC' and make them always static since kernels shouldn't have
static symbols stripped anyway, and debugging kernels definitely don't),
group global variables together and note that they're used as globals).
* Export the following as option-settable and patchable global variables:
apmdebug flags word that controls which APM debugging
printfs are printed, set with APMDEBUG_VALUE.
apm_enabled boolean that indicates whether or not APM should
ever be configured on the machine. true by
default, false if APM_DISABLE defined when
compiling. this option exists so that users
whose systems crash when APM is enabled can
disable it with a patchable kernel variable, and
therefore don't necessarily have to compile
a custom kernel as often. With this option set,
a check is still done to see if the APM BIOS
exists; this variable should be used to prevent
the kernel from ever attaching to the APM BIOS.
apm_force_64k_segments
boolean that tells segment setup code to always
use segments with 64k length. false by default,
true if APM_FORCE_64K_SEGMENTS defined when
compiling. used to just be a compile-time option.
apm_do_idle boolean that controls whether or not the APM code
will try to signal the BIOS that the system is
idle when in the idle loop. true by default,
false if APM_NO_IDLE defined when compiling.
apm_do_standby boolean that controls whether or not standby
requests are ever attempted. true by default,
false if APM_NO_STANDBY defined when compiling.
used to just be a compile-time option.
apm_v11_enabled boolean that controls whether or not the driver
attempts to use APM spec v1.1 features. If true,
the driver does (it implements v1.1 of the spec),
and if false the driver only uses v1.0 features.
true by default, false if APM_V10_ONLY is defined
when compiling. Really, the driver should be
updated to do APM v1.2 and this option should
either be updated or go the way of the dodo.
used to just be a compile-time option.
apm_bogus_bios (patchable only) controls a few of the APM segment
setup features. (probably should just be a global
and not patchable.)
* make apm_perror print out the full contents of %ax rather than
just the error code, in addition to printing out the string corresponding
to the error code.
* print estimated remaining battery life time as "[<hours>h ]<minutes>m",
which is actually easily understood, rather than as "<hours>:<minutes>
minutes", which is not.
* restructure match and attach so that they work as they should, remove
redundancy, support attaching the APM device but not actually enabling it
so that APM is attached on systems which have it but on which it's broken
in some fatal way.
* add more debugging printfs in the apm control device entry points.
* return EOPNOTSUPP when trying to do a standby ioctl if standbys have
been disabled, rather than returning the less-intuitive ENOTTY.
* rename a few functions for consistency: apmprobe -> apmmatch,
apm_err_translate -> apm_strerror.
* mark a few serious or annoying bogons XXX so people might look at
them later.
* KNF (lots of changes!)
Despite this substantial amount of work, this driver still needs a _lot_ of
work. In particular, the user-land device interface needs to be gutted, and
better support for APM-aware applications and device drivers (i.e. call-backs)
needs to be added (e.g. callback interfaces somewhat like those suggested
by the APM spec).
There are still outstanding known problems with some machines. The true
source of those problems is not currently known, and could be either the APM
BIOSes of the machines in question or this APM driver. However, even if the
problems are caused by APM BIOS bugs, they could be more gracefully worked
around in this driver.
failure. The latter usually would end up being the (nonzero) opcode
placed in %ax before the call, but could conceivably be modified by the
call to be zero. In any case, 0/1 is much nicer than 0/random-nonzero,
as well as being safer.
of the password file entry, not just first password file entry containing
$LOGNAME. (Fixes PR 3298 with a fix similar to that supplied in that PR
by Era Eriksson.)
* Ignore SIGINT and SIGQUIT (signals which are sent to the whole process
group) before editing sessions, and restore handler afterward, so that
SIGINTs and SIGQUITs delivered while editing (e.g. via Control-G in emacs)
don't cause send-pr to abort. (Fixes PRs 2530 and 2658.)
* When aborting because of a signal, if the PR has been modified from the
standard form, don't delete the edited copy (to prevent peoples' work
from being lost accidentally). (Fixes PR 2057.)