Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
0974fd35
Commit
0974fd35
authored
Jun 12, 2015
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
os2: inline ToLocale/LocaleFree
parent
df2ecdd4
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
19 deletions
+19
-19
src/os2/filesystem.c
src/os2/filesystem.c
+16
-16
src/os2/plugin.c
src/os2/plugin.c
+3
-3
No files found.
src/os2/filesystem.c
View file @
0974fd35
...
@@ -65,7 +65,7 @@ int vlc_open (const char *filename, int flags, ...)
...
@@ -65,7 +65,7 @@ int vlc_open (const char *filename, int flags, ...)
mode
=
va_arg
(
ap
,
unsigned
int
);
mode
=
va_arg
(
ap
,
unsigned
int
);
va_end
(
ap
);
va_end
(
ap
);
const
char
*
local_name
=
ToLocale
(
filename
);
const
char
*
local_name
=
ToLocale
Dup
(
filename
);
if
(
local_name
==
NULL
)
if
(
local_name
==
NULL
)
{
{
...
@@ -77,7 +77,7 @@ int vlc_open (const char *filename, int flags, ...)
...
@@ -77,7 +77,7 @@ int vlc_open (const char *filename, int flags, ...)
if
(
fd
!=
-
1
)
if
(
fd
!=
-
1
)
fcntl
(
fd
,
F_SETFD
,
FD_CLOEXEC
);
fcntl
(
fd
,
F_SETFD
,
FD_CLOEXEC
);
LocaleF
ree
(
local_name
);
f
ree
(
local_name
);
return
fd
;
return
fd
;
}
}
...
@@ -109,7 +109,7 @@ int vlc_openat (int dir, const char *filename, int flags, ...)
...
@@ -109,7 +109,7 @@ int vlc_openat (int dir, const char *filename, int flags, ...)
*/
*/
int
vlc_mkdir
(
const
char
*
dirname
,
mode_t
mode
)
int
vlc_mkdir
(
const
char
*
dirname
,
mode_t
mode
)
{
{
char
*
locname
=
ToLocale
(
dirname
);
char
*
locname
=
ToLocale
Dup
(
dirname
);
if
(
unlikely
(
locname
==
NULL
))
if
(
unlikely
(
locname
==
NULL
))
{
{
errno
=
ENOENT
;
errno
=
ENOENT
;
...
@@ -117,7 +117,7 @@ int vlc_mkdir (const char *dirname, mode_t mode)
...
@@ -117,7 +117,7 @@ int vlc_mkdir (const char *dirname, mode_t mode)
}
}
int
res
=
mkdir
(
locname
,
mode
);
int
res
=
mkdir
(
locname
,
mode
);
LocaleF
ree
(
locname
);
f
ree
(
locname
);
return
res
;
return
res
;
}
}
...
@@ -130,7 +130,7 @@ int vlc_mkdir (const char *dirname, mode_t mode)
...
@@ -130,7 +130,7 @@ int vlc_mkdir (const char *dirname, mode_t mode)
*/
*/
DIR
*
vlc_opendir
(
const
char
*
dirname
)
DIR
*
vlc_opendir
(
const
char
*
dirname
)
{
{
const
char
*
locname
=
ToLocale
(
dirname
);
const
char
*
locname
=
ToLocale
Dup
(
dirname
);
if
(
unlikely
(
locname
==
NULL
))
if
(
unlikely
(
locname
==
NULL
))
{
{
errno
=
ENOENT
;
errno
=
ENOENT
;
...
@@ -139,7 +139,7 @@ DIR *vlc_opendir (const char *dirname)
...
@@ -139,7 +139,7 @@ DIR *vlc_opendir (const char *dirname)
DIR
*
dir
=
opendir
(
locname
);
DIR
*
dir
=
opendir
(
locname
);
LocaleF
ree
(
locname
);
f
ree
(
locname
);
return
dir
;
return
dir
;
}
}
...
@@ -180,14 +180,14 @@ char *vlc_readdir( DIR *dir )
...
@@ -180,14 +180,14 @@ char *vlc_readdir( DIR *dir )
if
(
val
!=
0
)
if
(
val
!=
0
)
errno
=
val
;
errno
=
val
;
else
if
(
ent
!=
NULL
)
else
if
(
ent
!=
NULL
)
path
=
From
LocaleDup
(
ent
->
d_name
);
path
=
From
Charset
(
""
,
ent
->
d_name
,
strlen
(
ent
->
d_name
)
);
free
(
buf
);
free
(
buf
);
return
path
;
return
path
;
}
}
static
int
vlc_statEx
(
const
char
*
filename
,
struct
stat
*
buf
,
bool
deref
)
static
int
vlc_statEx
(
const
char
*
filename
,
struct
stat
*
buf
,
bool
deref
)
{
{
const
char
*
local_name
=
ToLocale
(
filename
);
const
char
*
local_name
=
ToLocale
Dup
(
filename
);
if
(
unlikely
(
local_name
==
NULL
))
if
(
unlikely
(
local_name
==
NULL
))
{
{
errno
=
ENOENT
;
errno
=
ENOENT
;
...
@@ -196,7 +196,7 @@ static int vlc_statEx (const char *filename, struct stat *buf, bool deref)
...
@@ -196,7 +196,7 @@ static int vlc_statEx (const char *filename, struct stat *buf, bool deref)
int
res
=
deref
?
stat
(
local_name
,
buf
)
int
res
=
deref
?
stat
(
local_name
,
buf
)
:
lstat
(
local_name
,
buf
);
:
lstat
(
local_name
,
buf
);
LocaleF
ree
(
local_name
);
f
ree
(
local_name
);
return
res
;
return
res
;
}
}
...
@@ -231,7 +231,7 @@ int vlc_lstat (const char *filename, struct stat *buf)
...
@@ -231,7 +231,7 @@ int vlc_lstat (const char *filename, struct stat *buf)
*/
*/
int
vlc_unlink
(
const
char
*
filename
)
int
vlc_unlink
(
const
char
*
filename
)
{
{
const
char
*
local_name
=
ToLocale
(
filename
);
const
char
*
local_name
=
ToLocale
Dup
(
filename
);
if
(
unlikely
(
local_name
==
NULL
))
if
(
unlikely
(
local_name
==
NULL
))
{
{
errno
=
ENOENT
;
errno
=
ENOENT
;
...
@@ -239,7 +239,7 @@ int vlc_unlink (const char *filename)
...
@@ -239,7 +239,7 @@ int vlc_unlink (const char *filename)
}
}
int
ret
=
unlink
(
local_name
);
int
ret
=
unlink
(
local_name
);
LocaleF
ree
(
local_name
);
f
ree
(
local_name
);
return
ret
;
return
ret
;
}
}
...
@@ -253,22 +253,22 @@ int vlc_unlink (const char *filename)
...
@@ -253,22 +253,22 @@ int vlc_unlink (const char *filename)
*/
*/
int
vlc_rename
(
const
char
*
oldpath
,
const
char
*
newpath
)
int
vlc_rename
(
const
char
*
oldpath
,
const
char
*
newpath
)
{
{
const
char
*
lo
=
ToLocale
(
oldpath
);
const
char
*
lo
=
ToLocale
Dup
(
oldpath
);
if
(
lo
==
NULL
)
if
(
lo
==
NULL
)
goto
error
;
goto
error
;
const
char
*
ln
=
ToLocale
(
newpath
);
const
char
*
ln
=
ToLocale
Dup
(
newpath
);
if
(
ln
==
NULL
)
if
(
ln
==
NULL
)
{
{
LocaleF
ree
(
lo
);
f
ree
(
lo
);
error:
error:
errno
=
ENOENT
;
errno
=
ENOENT
;
return
-
1
;
return
-
1
;
}
}
int
ret
=
rename
(
lo
,
ln
);
int
ret
=
rename
(
lo
,
ln
);
LocaleF
ree
(
lo
);
f
ree
(
lo
);
LocaleF
ree
(
ln
);
f
ree
(
ln
);
return
ret
;
return
ret
;
}
}
...
...
src/os2/plugin.c
View file @
0974fd35
...
@@ -49,16 +49,16 @@ int module_Load( vlc_object_t *p_this, const char *psz_file,
...
@@ -49,16 +49,16 @@ int module_Load( vlc_object_t *p_this, const char *psz_file,
module_handle_t
*
p_handle
,
bool
lazy
)
module_handle_t
*
p_handle
,
bool
lazy
)
{
{
const
int
flags
=
lazy
?
RTLD_LAZY
:
RTLD_NOW
;
const
int
flags
=
lazy
?
RTLD_LAZY
:
RTLD_NOW
;
char
*
path
=
ToLocale
(
psz_file
);
char
*
path
=
ToLocale
Dup
(
psz_file
);
module_handle_t
handle
=
dlopen
(
path
,
flags
);
module_handle_t
handle
=
dlopen
(
path
,
flags
);
if
(
handle
==
NULL
)
if
(
handle
==
NULL
)
{
{
msg_Warn
(
p_this
,
"cannot load module `%s' (%s)"
,
path
,
dlerror
()
);
msg_Warn
(
p_this
,
"cannot load module `%s' (%s)"
,
path
,
dlerror
()
);
LocaleF
ree
(
path
);
f
ree
(
path
);
return
-
1
;
return
-
1
;
}
}
LocaleF
ree
(
path
);
f
ree
(
path
);
*
p_handle
=
handle
;
*
p_handle
=
handle
;
return
0
;
return
0
;
}
}
...
...
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