Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
ccan
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
mirror
ccan
Commits
93bdadc1
Commit
93bdadc1
authored
Nov 20, 2015
by
Rusty Russell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tools/namespacize: use unlink_noerr.
Signed-off-by:
Rusty Russell
<
rusty@rustcorp.com.au
>
parent
d262c52e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
10 deletions
+2
-10
tools/namespacize.c
tools/namespacize.c
+2
-10
No files found.
tools/namespacize.c
View file @
93bdadc1
...
@@ -15,6 +15,7 @@
...
@@ -15,6 +15,7 @@
#include "ccan/tal/path/path.h"
#include "ccan/tal/path/path.h"
#include "ccan/tal/grab_file/grab_file.h"
#include "ccan/tal/grab_file/grab_file.h"
#include "ccan/err/err.h"
#include "ccan/err/err.h"
#include "ccan/noerr/noerr.h"
#include "tools.h"
#include "tools.h"
static
bool
verbose
=
false
;
static
bool
verbose
=
false
;
...
@@ -29,15 +30,6 @@ static int indent = 0;
...
@@ -29,15 +30,6 @@ static int indent = 0;
#define verbose_indent() (indent += 2)
#define verbose_indent() (indent += 2)
#define verbose_unindent() (indent -= 2)
#define verbose_unindent() (indent -= 2)
static
int
unlink_no_errno
(
const
char
*
filename
)
{
int
ret
=
0
,
serrno
=
errno
;
if
(
unlink
(
filename
)
<
0
)
ret
=
errno
;
errno
=
serrno
;
return
ret
;
}
static
char
**
get_dir
(
const
char
*
dir
)
static
char
**
get_dir
(
const
char
*
dir
)
{
{
DIR
*
d
;
DIR
*
d
;
...
@@ -292,7 +284,7 @@ static void write_replacement_file(const char *dir, struct replace **repl)
...
@@ -292,7 +284,7 @@ static void write_replacement_file(const char *dir, struct replace **repl)
for
(
r
=
*
repl
;
r
;
r
=
r
->
next
)
{
for
(
r
=
*
repl
;
r
;
r
=
r
->
next
)
{
if
(
write
(
fd
,
r
->
string
,
strlen
(
r
->
string
))
!=
strlen
(
r
->
string
)
if
(
write
(
fd
,
r
->
string
,
strlen
(
r
->
string
))
!=
strlen
(
r
->
string
)
||
write
(
fd
,
"
\n
"
,
1
)
!=
1
)
{
||
write
(
fd
,
"
\n
"
,
1
)
!=
1
)
{
unlink_no
_errno
(
replname
);
unlink_no
err
(
replname
);
if
(
errno
==
0
)
if
(
errno
==
0
)
errx
(
1
,
"Short write to %s: disk full?"
,
errx
(
1
,
"Short write to %s: disk full?"
,
replname
);
replname
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment