FAI ainsl exit code, softupdate, scripts/FAIBASE/10-misc

Michael Tautschnig mt at debian.org
Mon Jun 28 11:58:44 CEST 2010


[...]

> 
> I also noticed a possible not detected error.  That is the "print"
> and "close" at the end of the ainsl source.  If for some reason the
> target file system is full, the error returned by print or, more
> probably "close" would be ignored.  This would return the exit code
> 28 - No space left on device.  My recommendation would be to add
> "die" statements to the last 2 lines of the file:
> 
>    print INFILE $line,"\n" || die "ainsl: cannot print to file
>    $filename: $!";
>    close(INFILE) or die "ainsl: error saving file $filename: $!";
> 
> 
> On a full file system, the above "close" will return 28, "No space
> left on device".  I think that should also be listed in EXIT CODES
> (if we add a check for the close return value in ainsl source). So
> maybe the document would say:
> 
>    .TP
>    .B 13
>    Permissions do not allow writing to FILE and LINE/PATTERN was not
>    found in file.
>    .TP
>    .B 28
>    FILE cannot written because the filesystem has no space and
>    LINE/PATTERN was not found in file.
>    .TP
>    .B 30
>    FILE cannot written because the filesystem is read-only and
>    LINE/PATTERN was not found in file.
> 
> Or, we could be simple and say only that any non-zero means that
> ainsl failed to verify or add PATTERN in FILE.  Alternative:
> 
>    .TP
>    .B non-zero
>    Either FILE does not exist or FILE does not contain PATTERN/LINE and
>    cannot be written.  A diagnostic message will be printed on stderr
>    which explains the details.
> 
> 
> In all cases, it seems a good idea to check the return code of the
> final print and close statements.
> 

I've added that to the patch in experimental (now included in
3.4~beta4+experimental4) and chose the more complete version of the man-page
update as you suggested above. It will be up to Thomas to decide whether this is
ok with him for mainline...

Best,
Michael

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
Url : http://lists.uni-koeln.de/pipermail/linux-fai/attachments/20100628/f86ec374/attachment.bin 


More information about the linux-fai mailing list