summaryrefslogtreecommitdiff
path: root/setfattr/setfattr.c
diff options
context:
space:
mode:
authorNathan Scott <nathans@sgi.com>2003-07-29 01:21:25 +0000
committerNathan Scott <nathans@sgi.com>2003-07-29 01:21:25 +0000
commitd141df65f1b4ebb05f57d74b4afd1e8812f327d5 (patch)
tree7fdea8757861a848dc8681ab3aea01efbf83e876 /setfattr/setfattr.c
parentff170d22ca9ae0b1c362e33a4ab2fbd85ca79b86 (diff)
downloadattr-d141df65f1b4ebb05f57d74b4afd1e8812f327d5.tar.gz
Little attr libmisc update from Andreas to ensure we dont exit from the library
Diffstat (limited to 'setfattr/setfattr.c')
-rw-r--r--setfattr/setfattr.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/setfattr/setfattr.c b/setfattr/setfattr.c
index d9d1ad2..21b02ee 100644
--- a/setfattr/setfattr.c
+++ b/setfattr/setfattr.c
@@ -70,6 +70,16 @@ const char *strerror_ea(int err)
return strerror(err);
}
+static const char *xquote(const char *str)
+{
+ const char *q = quote(str);
+ if (q == NULL) {
+ fprintf(stderr, "%s: %s\n", progname, strerror(errno));
+ exit(1);
+ }
+ return q;
+}
+
int do_setxattr(const char *path, const char *name,
const void *value, size_t size)
{
@@ -270,7 +280,7 @@ int do_set(const char *path, const char *name, const char *value)
if (error < 0) {
fprintf(stderr, "%s: %s: %s\n",
- progname, quote(path), strerror_ea(errno));
+ progname, xquote(path), strerror_ea(errno));
had_errors++;
return 1;
}