[Top][All Lists]

[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 <>,
ivo welch <> 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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]