mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-03-25 10:50:08 +03:00
shell: Remove access(2) checks
The checks didn't handle stdout. Since unistd.h wasn't included, W_OK wasn't defined and the checks wouldn't run anyway.
This commit is contained in:
parent
aa6ca0b1d3
commit
d04e152d9c
14
shell.c
14
shell.c
@ -774,13 +774,6 @@ xmllintShellWrite(xmllintShellCtxtPtr ctxt, char *filename, xmlNodePtr node,
|
||||
if ((filename == NULL) || (filename[0] == 0)) {
|
||||
return (-1);
|
||||
}
|
||||
#ifdef W_OK
|
||||
if (access((char *) filename, W_OK)) {
|
||||
fprintf(ctxt->output,
|
||||
"Cannot write to %s\n", filename);
|
||||
return (-1);
|
||||
}
|
||||
#endif
|
||||
switch (node->type) {
|
||||
case XML_DOCUMENT_NODE:
|
||||
if (xmlSaveFile((char *) filename, ctxt->doc) < -1) {
|
||||
@ -843,13 +836,6 @@ xmllintShellSave(xmllintShellCtxtPtr ctxt, char *filename,
|
||||
filename = ctxt->filename;
|
||||
if (filename == NULL)
|
||||
return (-1);
|
||||
#ifdef W_OK
|
||||
if (access((char *) filename, W_OK)) {
|
||||
fprintf(ctxt->output,
|
||||
"Cannot save to %s\n", filename);
|
||||
return (-1);
|
||||
}
|
||||
#endif
|
||||
switch (ctxt->doc->type) {
|
||||
case XML_DOCUMENT_NODE:
|
||||
if (xmlSaveFile((char *) filename, ctxt->doc) < 0) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user