/sbin/dump: instant exit in case of disk full (instead of prompting for next volume)
Matthias Petermann
matthias at petermann-it.de
Wed Dec 12 22:02:32 UTC 2018
Hi,
On 07.12.18 09:28, Polytropon wrote:
> However, you could modify the dump program to exit with a
> specific error code if "disk is full" should be reached.
My first take on that was that I implemented some kind of auto-reply
switch and modified the query() method in optr.c. Anyway - what I found
there was already the solution for my root problem that I did not want
dump to wait for user input while started from cron:
int
query(const char *question, int defaultreply)
{
char replybuffer[64];
int back, errcount;
FILE *mytty;
if ((mytty = fopen(_PATH_TTY, "r")) == NULL)
quit("fopen on %s fails: %s\n", _PATH_TTY, strerror(errno));
I'm sorry that I did not do this kind of test earlier. If there is no
controlling terminal, all attempts of dump to interact with the user
will lead to exit with status code 3. This is enough for me at the
moment, but I still am in favor of having an explicit return code in
case the disk is full. When I find some time I will look how this could
be implemented properly.
Kind regards,
Matthias
--
Matthias Petermann <matthias at petermann-it.de> | www.petermann-it.de
More information about the freebsd-questions
mailing list