/*
* Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2007 Hiroyuki Yamamoto and the Claws Mail team
+ * Copyright (C) 1999-2009 Hiroyuki Yamamoto and the Claws Mail team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
g_warning("can't write to temporary file\n"); \
fclose(tmp_fp); \
fclose(mbox_fp); \
- g_unlink(tmp_file); \
+ claws_unlink(tmp_file); \
g_free(tmp_file); \
return -1; \
} \
g_warning("malformed mbox: %s: message %d is empty\n", mbox, msgs);
fclose(tmp_fp);
fclose(mbox_fp);
- g_unlink(tmp_file);
+ claws_unlink(tmp_file);
return -1;
}
FILE_OP_ERROR(tmp_file, "fclose");
g_warning("can't write to temporary file\n");
fclose(mbox_fp);
- g_unlink(tmp_file);
+ claws_unlink(tmp_file);
g_free(tmp_file);
return -1;
}
if (apply_filter) {
if ((msgnum = folder_item_add_msg(dropfolder, tmp_file, NULL, TRUE)) < 0) {
fclose(mbox_fp);
- g_unlink(tmp_file);
+ claws_unlink(tmp_file);
g_free(tmp_file);
return -1;
}
FILE_OP_ERROR(lockfile, "link");
if (retry >= 5) {
g_warning("can't create %s\n", lockfile);
- g_unlink(lockfile);
+ claws_unlink(lockfile);
g_free(lockfile);
return -1;
}
retry++;
sleep(5);
}
- g_unlink(lockfile);
+ claws_unlink(lockfile);
g_free(lockfile);
} else if (type == LOCK_FLOCK) {
gint lockfd;
#endif
#if HAVE_FLOCK
- if ((lockfd = open(base, O_RDWR)) < 0) {
+ if ((lockfd = g_open(base, O_RDWR)) < 0) {
#else
- if ((lockfd = open(base, O_RDWR)) < 0) {
+ if ((lockfd = g_open(base, O_RDWR)) < 0) {
#endif
FILE_OP_ERROR(base, "open");
return -1;
gchar *lockfile;
lockfile = g_strconcat(base, ".lock", NULL);
- if (g_unlink(lockfile) < 0) {
+ if (claws_unlink(lockfile) < 0) {
FILE_OP_ERROR(lockfile, "unlink");
g_free(lockfile);
return -1;
if (fwrite(buf, 1, n_read, dest_fp) < n_read) {
g_warning("writing to %s failed.\n", dest);
fclose(dest_fp);
- g_unlink(dest);
+ claws_unlink(dest);
return -1;
}
}
}
if (err) {
- g_unlink(dest);
+ claws_unlink(dest);
return -1;
}