mirror of
https://github.com/upx/upx
synced 2025-09-28 19:06:07 +08:00
Don't try to unlink the temp file more than once.
committer: mfx <mfx> 975606488 +0000
This commit is contained in:
parent
3cff21e90e
commit
b286b2d3c2
|
@ -227,14 +227,15 @@ void do_one_file(const char *iname, char *oname)
|
||||||
|
|
||||||
#if !defined(WITH_GUI)
|
#if !defined(WITH_GUI)
|
||||||
|
|
||||||
static void unlink_ofile(const char *oname)
|
static void unlink_ofile(char *oname)
|
||||||
{
|
{
|
||||||
if (oname && oname[0])
|
if (oname && oname[0])
|
||||||
{
|
{
|
||||||
#if defined(HAVE_CHMOD)
|
#if defined(HAVE_CHMOD)
|
||||||
(void) ::chmod(oname, 0777);
|
(void) ::chmod(oname, 0777);
|
||||||
#endif
|
#endif
|
||||||
(void) ::unlink(oname);
|
if (::unlink(oname) == 0)
|
||||||
|
oname[0] = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user