X-Git-Url: http://git.osdn.jp/view?a=blobdiff_plain;f=gtk%2Fsrc%2Fpresets.c;h=66f69a748badedbb635503cb4b0fa06e12be09fe;hb=0884cb45aeeb60a46effe1d1056a61fe68300ea7;hp=7d7e844301a3e44b639260ffbb1e9bfbcd2d7bc9;hpb=38411ed3d2e33bd434f7f255279924eba7c55e46;p=handbrake-jp%2Fhandbrake-jp-git.git diff --git a/gtk/src/presets.c b/gtk/src/presets.c index 7d7e8443..66f69a74 100644 --- a/gtk/src/presets.c +++ b/gtk/src/presets.c @@ -1211,7 +1211,6 @@ ghb_find_pid_file() if (strncmp(file, "ghb.pid.", 8) == 0) { gchar *path; - int fd, lock = 1; pid_t my_pid; int pid; @@ -1222,9 +1221,12 @@ ghb_find_pid_file() file = g_dir_read_name(gdir); continue; } - path = g_strdup_printf("%s/%s", config, file); - fd = g_open(path, O_RDWR); + +#if !defined(_WIN32) + int fd, lock = 1; + + fd = open(path, O_RDWR); if (fd >= 0) { lock = lockf(fd, F_TLOCK, 0); @@ -1240,6 +1242,13 @@ ghb_find_pid_file() } g_free(path); close(fd); +#else + g_dir_close(gdir); + g_unlink(path); + g_free(path); + g_free(config); + return pid; +#endif } file = g_dir_read_name(gdir); }