Merge "Use err() instead of error() in mkbootfs" am: 6f2dab0ba7

Original change: https://android-review.googlesource.com/c/platform/system/core/+/2381332

Change-Id: I4dfb555445a2f300c0de6f06486878452ddd8785
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Colin Cross 2023-01-10 00:41:07 +00:00 committed by Automerger Merge Worker
commit 20f0f49b0d

View file

@ -1,12 +1,12 @@
#include <error.h>
#include <ctype.h>
#include <err.h>
#include <errno.h>
#include <getopt.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <ctype.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
@ -342,8 +342,7 @@ static void read_canned_config(char* filename)
static void devnodes_desc_error(const char* filename, unsigned long line_num,
const char* msg)
{
error(EXIT_FAILURE, 0, "failed to read nodes desc file '%s' line %lu: %s",
filename, line_num, msg);
errx(EXIT_FAILURE, "failed to read nodes desc file '%s' line %lu: %s", filename, line_num, msg);
}
static int append_devnodes_desc_dir(char* path, char* args)
@ -388,8 +387,7 @@ static int append_devnodes_desc_nod(char* path, char* args)
static void append_devnodes_desc(const char* filename)
{
FILE* f = fopen(filename, "re");
if (!f) error(EXIT_FAILURE, errno,
"failed to open nodes description file '%s'", filename);
if (!f) err(EXIT_FAILURE, "failed to open nodes description file '%s'", filename);
char *line, *args, *type, *path;
unsigned long line_num = 0;