mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-11-16 23:57:54 +01:00
This commit was generated by cvs2svn to compensate for changes in r22839,
which included commits to RCS files with non-trunk default branches.
This commit is contained in:
commit
c1530c7bf3
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=22840
@ -30,10 +30,9 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)extern.h 8.1 (Berkeley) 6/5/93
|
||||
* @(#)extern.h 8.2 (Berkeley) 4/28/95
|
||||
*/
|
||||
|
||||
void err __P((const char *, ...));
|
||||
void get __P((int, off_t, void *, size_t));
|
||||
|
||||
extern char *special;
|
||||
|
@ -32,15 +32,17 @@
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char sccsid[] = "@(#)misc.c 8.1 (Berkeley) 6/5/93";
|
||||
static char sccsid[] = "@(#)misc.c 8.2 (Berkeley) 4/28/95";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <err.h>
|
||||
#include <errno.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include "extern.h"
|
||||
|
||||
void
|
||||
@ -53,38 +55,9 @@ get(fd, off, p, len)
|
||||
int rbytes;
|
||||
|
||||
if (lseek(fd, off, SEEK_SET) < 0)
|
||||
err("%s: %s", special, strerror(errno));
|
||||
err(1, "%s", special);
|
||||
if ((rbytes = read(fd, p, len)) < 0)
|
||||
err("%s: %s", special, strerror(errno));
|
||||
err(1, "%s", special);
|
||||
if (rbytes != len)
|
||||
err("%s: short read (%d, not %d)", special, rbytes, len);
|
||||
}
|
||||
|
||||
#if __STDC__
|
||||
#include <stdarg.h>
|
||||
#else
|
||||
#include <varargs.h>
|
||||
#endif
|
||||
|
||||
void
|
||||
#if __STDC__
|
||||
err(const char *fmt, ...)
|
||||
#else
|
||||
err(fmt, va_alist)
|
||||
char *fmt;
|
||||
va_dcl
|
||||
#endif
|
||||
{
|
||||
va_list ap;
|
||||
#if __STDC__
|
||||
va_start(ap, fmt);
|
||||
#else
|
||||
va_start(ap);
|
||||
#endif
|
||||
(void)fprintf(stderr, "dumplfs: ");
|
||||
(void)vfprintf(stderr, fmt, ap);
|
||||
va_end(ap);
|
||||
(void)fprintf(stderr, "\n");
|
||||
exit(1);
|
||||
/* NOTREACHED */
|
||||
errx(1, "%s: short read (%d, not %d)", special, rbytes, len);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user