[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: tar exit codes?
From: |
Alan Curry |
Subject: |
Re: tar exit codes? |
Date: |
25 Apr 2004 10:31:21 GMT |
In article <5159bba2.0404241615.2f45d1d2@posting.google.com>,
ivo welch <ivo.welch@anderson.ucla.edu> wrote:
>I was looking at "info tar", "man tar", and "tar --help", but could
>not find documentation for the gnu tar exit codes. I am getting an
>exit code of 512 upon creating an 8.9GB tar archive (of my main
>partition), but I do not think it overflowed the filesystem (ext3),
>nor do I see any other error in the created archive. (generated by
>tar -clf). still, trusting my data backups to tar, I would want to be
>able to check whether everything went alright. should I be concerned?
Are you by chance running this tar in an environment where fd 1 (stdout) is
closed? tar attempts to fclose(stdout) before exiting, even if you didn't ask
it to use stdout and nothing was written there. If that fails with EBADF, tar
exits with a failure code. It tries to write an error message to stderr, but
if you don't have a stdout you probably don't have a stderr either.
If this is the case, try opening /dev/null on your fd 1 before you run tar.
It will be happy because it can close stdout, after having not used it.
I reported this (and sent a patch) to bug-tar last month and got no reply.
--
Alan Curry
pacman@clss.net