Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
criu
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhul
criu
Commits
dd4d829d
Commit
dd4d829d
authored
Nov 15, 2011
by
Cyrill Gorcunov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
util: Add error messages into files/dirs open helper
Signed-off-by:
Cyrill Gorcunov
<
gorcunov@gmail.com
>
parent
1c5f981e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
3 deletions
+15
-3
util.c
util.c
+15
-3
No files found.
util.c
View file @
dd4d829d
...
@@ -414,6 +414,7 @@ err_bogus_mapping:
...
@@ -414,6 +414,7 @@ err_bogus_mapping:
DIR
*
opendir_proc
(
char
*
fmt
,
...)
DIR
*
opendir_proc
(
char
*
fmt
,
...)
{
{
DIR
*
dir
;
char
path
[
128
];
char
path
[
128
];
va_list
args
;
va_list
args
;
...
@@ -422,11 +423,15 @@ DIR *opendir_proc(char *fmt, ...)
...
@@ -422,11 +423,15 @@ DIR *opendir_proc(char *fmt, ...)
vsnprintf
(
path
+
6
,
sizeof
(
path
)
-
6
,
fmt
,
args
);
vsnprintf
(
path
+
6
,
sizeof
(
path
)
-
6
,
fmt
,
args
);
va_end
(
args
);
va_end
(
args
);
return
opendir
(
path
);
dir
=
opendir
(
path
);
if
(
!
dir
)
pr_perror
(
"Can't open %s
\n
"
,
path
);
return
dir
;
}
}
FILE
*
fopen_proc
(
char
*
fmt
,
char
*
mode
,
...)
FILE
*
fopen_proc
(
char
*
fmt
,
char
*
mode
,
...)
{
{
FILE
*
file
;
char
fname
[
128
];
char
fname
[
128
];
va_list
args
;
va_list
args
;
...
@@ -435,11 +440,15 @@ FILE *fopen_proc(char *fmt, char *mode, ...)
...
@@ -435,11 +440,15 @@ FILE *fopen_proc(char *fmt, char *mode, ...)
vsnprintf
(
fname
+
6
,
sizeof
(
fname
)
-
6
,
fmt
,
args
);
vsnprintf
(
fname
+
6
,
sizeof
(
fname
)
-
6
,
fmt
,
args
);
va_end
(
args
);
va_end
(
args
);
return
fopen
(
fname
,
mode
);
file
=
fopen
(
fname
,
mode
);
if
(
!
file
)
pr_perror
(
"Can't open %s
\n
"
,
fname
);
return
file
;
}
}
int
open_fmt
(
char
*
fmt
,
int
mode
,
...)
int
open_fmt
(
char
*
fmt
,
int
mode
,
...)
{
{
int
fd
;
char
fname
[
128
];
char
fname
[
128
];
va_list
args
;
va_list
args
;
...
@@ -447,5 +456,8 @@ int open_fmt(char *fmt, int mode, ...)
...
@@ -447,5 +456,8 @@ int open_fmt(char *fmt, int mode, ...)
vsnprintf
(
fname
,
sizeof
(
fname
),
fmt
,
args
);
vsnprintf
(
fname
,
sizeof
(
fname
),
fmt
,
args
);
va_end
(
args
);
va_end
(
args
);
return
open
(
fname
,
mode
);
fd
=
open
(
fname
,
mode
);
if
(
fd
<
0
)
pr_perror
(
"Can't open %s
\n
"
,
fname
);
return
fd
;
}
}
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