mirror of
https://github.com/ckolivas/lrzip.git
synced 2025-12-06 07:12:00 +01:00
Print perror before unlinking files.
Join common parts of fatal errors. Update copyright notices. Small improvement to visual output.
This commit is contained in:
parent
a7b4708bd2
commit
88e3df6af1
7
main.c
7
main.c
|
|
@ -1,5 +1,6 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2006-2011 Con Kolivas
|
Copyright (C) 2006-2011 Con Kolivas
|
||||||
|
Copyright (C) 2011 Peter Hyman
|
||||||
Copyright (C) 1998-2003 Andrew Tridgell
|
Copyright (C) 1998-2003 Andrew Tridgell
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
This program is free software; you can redistribute it and/or modify
|
||||||
|
|
@ -23,10 +24,10 @@ struct rzip_control control;
|
||||||
static void usage(void)
|
static void usage(void)
|
||||||
{
|
{
|
||||||
print_output("lrzip version %d.%d%d\n", LRZIP_MAJOR_VERSION, LRZIP_MINOR_VERSION, LRZIP_MINOR_SUBVERSION);
|
print_output("lrzip version %d.%d%d\n", LRZIP_MAJOR_VERSION, LRZIP_MINOR_VERSION, LRZIP_MINOR_SUBVERSION);
|
||||||
print_output("Copyright (C) Con Kolivas 2006-2011\n\n");
|
print_output("Copyright (C) Con Kolivas 2006-2011\n");
|
||||||
print_output("Based on rzip ");
|
print_output("Based on rzip ");
|
||||||
print_output("Copyright (C) Andrew Tridgell 1998-2003\n");
|
print_output("Copyright (C) Andrew Tridgell 1998-2003\n\n");
|
||||||
print_output("usage: lrzip [options] <file...>\n");
|
print_output("Usage: lrzip [options] <file...>\n");
|
||||||
print_output("General options:\n");
|
print_output("General options:\n");
|
||||||
print_output(" -c check integrity of file written on decompression\n");
|
print_output(" -c check integrity of file written on decompression\n");
|
||||||
print_output(" -d decompress\n");
|
print_output(" -d decompress\n");
|
||||||
|
|
|
||||||
1
rzip.h
1
rzip.h
|
|
@ -1,5 +1,6 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2006-2011 Con Kolivas
|
Copyright (C) 2006-2011 Con Kolivas
|
||||||
|
Copyright (C) 2011 Peter Hyman
|
||||||
Copyright (C) 1998 Andrew Tridgell
|
Copyright (C) 1998 Andrew Tridgell
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
This program is free software; you can redistribute it and/or modify
|
||||||
|
|
|
||||||
1
stream.c
1
stream.c
|
|
@ -1,5 +1,6 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2006-2011 Con Kolivas
|
Copyright (C) 2006-2011 Con Kolivas
|
||||||
|
Copyright (C) 2011 Peter Hyman
|
||||||
Copyright (C) 1998 Andrew Tridgell
|
Copyright (C) 1998 Andrew Tridgell
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
This program is free software; you can redistribute it and/or modify
|
||||||
|
|
|
||||||
17
util.c
17
util.c
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2006-2011 Con Kolivas
|
Copyright (C) 2006-2011 Con Kolivas
|
||||||
Copyright (C) 2008 Peter Hyman
|
Copyright (C) 2008, 2011 Peter Hyman
|
||||||
Copyright (C) 1998 Andrew Tridgell
|
Copyright (C) 1998 Andrew Tridgell
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
This program is free software; you can redistribute it and/or modify
|
||||||
|
|
@ -42,6 +42,13 @@ static void unlink_files(void)
|
||||||
unlink(control.infile);
|
unlink(control.infile);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void fatal_exit(void)
|
||||||
|
{
|
||||||
|
unlink_files();
|
||||||
|
print_output("Fatal error - exiting\n");
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
/* Failure when there is likely to be a meaningful error in perror */
|
/* Failure when there is likely to be a meaningful error in perror */
|
||||||
void fatal(const char *format, ...)
|
void fatal(const char *format, ...)
|
||||||
{
|
{
|
||||||
|
|
@ -53,10 +60,8 @@ void fatal(const char *format, ...)
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
}
|
}
|
||||||
|
|
||||||
unlink_files();
|
|
||||||
perror(NULL);
|
perror(NULL);
|
||||||
print_output("Fatal error - exiting\n");
|
fatal_exit();
|
||||||
exit(1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void failure(const char *format, ...)
|
void failure(const char *format, ...)
|
||||||
|
|
@ -69,9 +74,7 @@ void failure(const char *format, ...)
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
}
|
}
|
||||||
|
|
||||||
unlink_files();
|
fatal_exit();
|
||||||
print_output("Fatal error - exiting\n");
|
|
||||||
exit(1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void sighandler()
|
void sighandler()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue