projects
/
debian
/
cpmtools
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge commit 'upstream/2.12'
[debian/cpmtools]
/
cpmchattr.c
diff --git
a/cpmchattr.c
b/cpmchattr.c
index 9fbf074ca1934bcacb5ad72304e45cbe4467bd48..aaecdc7328151c7b41025dc1e0ab27fdf902ea00 100644
(file)
--- a/
cpmchattr.c
+++ b/
cpmchattr.c
@@
-1,12
+1,17
@@
/* #includes */ /*{{{C}}}*//*{{{*/
/* #includes */ /*{{{C}}}*//*{{{*/
+#include "config.h"
+
#include <ctype.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <ctype.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
-#include "config.h"
-#include "getopt.h"
+#include "getopt
_
.h"
#include "cpmfs.h"
#include "cpmfs.h"
+
+#ifdef USE_DMALLOC
+#include <dmalloc.h>
+#endif
/*}}}*/
const char cmd[]="cpmchattr";
/*}}}*/
const char cmd[]="cpmchattr";
@@
-38,8
+43,8
@@
int main(int argc, char *argv[]) /*{{{*/
if (optind>=(argc-2)) usage=1;
else
{
if (optind>=(argc-2)) usage=1;
else
{
- image=argv[optind];
- attrs = argv[optind+
1
];
+ image=argv[optind
++
];
+ attrs = argv[optind+
+
];
}
if (usage)
}
if (usage)
@@
-60,12
+65,12
@@
int main(int argc, char *argv[]) /*{{{*/
for (i=0; i<gargc; ++i)
{
struct cpmInode ino;
for (i=0; i<gargc; ++i)
{
struct cpmInode ino;
- int
err
;
+ int
rc
;
cpm_attr_t attrib;
cpm_attr_t attrib;
-
err
= cpmNamei(&root,gargv[i], &ino)==-1;
- if (!
err) err
= cpmAttrGet(&ino, &attrib);
- if (!
err
)
+
rc
= cpmNamei(&root,gargv[i], &ino)==-1;
+ if (!
rc) rc
= cpmAttrGet(&ino, &attrib);
+ if (!
rc
)
{
int n, m;
m = 0;
{
int n, m;
m = 0;
@@
-93,9
+98,9
@@
int main(int argc, char *argv[]) /*{{{*/
}
if (m) attrib &= ~mask; else attrib |= mask;
}
}
if (m) attrib &= ~mask; else attrib |= mask;
}
-
err
= cpmAttrSet(&ino, attrib);
+
rc
= cpmAttrSet(&ino, attrib);
}
}
- if (
err
)
+ if (
rc
)
{
fprintf(stderr,"%s: can not set attributes for %s: %s\n",cmd,gargv[i],boo);
exitcode=1;
{
fprintf(stderr,"%s: can not set attributes for %s: %s\n",cmd,gargv[i],boo);
exitcode=1;