Commit 48392713 authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann

app/core/gimpdata.c app/file/file-save.c use g_access() from gstdio.h.

2005-09-26  Sven Neumann  <sven@gimp.org>

	* app/core/gimpdata.c
	* app/file/file-save.c
	* app/file/file-open.c: use g_access() from gstdio.h.

	* app/config/gimpconfig-file.c (gimp_config_file_copy)
	* libgimpthumb/gimpthumbnail.c: use g_chmod() from gstdio.h.

	* app/file/gimprecentlist.c
	* libgimpconfig/gimpconfigwriter.c: use g_creat() from gstdio.h.
parent a0a13c87
2005-09-26 Sven Neumann <sven@gimp.org>
* app/core/gimpdata.c
* app/file/file-save.c
* app/file/file-open.c: use g_access() from gstdio.h.
* app/config/gimpconfig-file.c (gimp_config_file_copy)
* libgimpthumb/gimpthumbnail.c: use g_chmod() from gstdio.h.
* app/file/gimprecentlist.c
* libgimpconfig/gimpconfigwriter.c: use g_creat() from gstdio.h.
2005-09-26 Michael Natterer <mitch@gimp.org>
* menus/image-menu.xml.in: added Colors/Modify placeholder.
......
......@@ -104,7 +104,7 @@ gimp_config_file_copy (const gchar *source,
if (g_stat (source, &stat_buf) == 0)
{
chmod (dest, stat_buf.st_mode);
g_chmod (dest, stat_buf.st_mode);
}
return TRUE;
......
......@@ -481,10 +481,10 @@ gimp_data_set_filename (GimpData *data,
{
gchar *dirname = g_path_get_dirname (filename);
if ((access (filename, F_OK) == 0 && /* check if the file exists */
access (filename, W_OK) == 0) || /* and is writable */
(access (filename, F_OK) != 0 && /* OR doesn't exist */
access (dirname, W_OK) == 0)) /* and we can write to its dir */
if ((g_access (filename, F_OK) == 0 && /* check if the file exists */
g_access (filename, W_OK) == 0) || /* and is writable */
(g_access (filename, F_OK) != 0 && /* OR doesn't exist */
g_access (dirname, W_OK) == 0)) /* and we can write to its dir */
{
data->writable = writable ? TRUE : FALSE;
data->deletable = deletable ? TRUE : FALSE;
......
......@@ -22,22 +22,23 @@
#include "config.h"
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#ifdef HAVE_SYS_PARAM_H
#include <sys/param.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <glib-object.h>
#include <glib/gstdio.h>
#ifdef G_OS_WIN32
#include <io.h>
#define R_OK 4
#define access(f,p) _access(f,p)
#endif
#include "core/core-types.h"
......@@ -121,7 +122,7 @@ file_open_image (Gimp *gimp,
return NULL;
}
if (access (filename, R_OK) != 0)
if (g_access (filename, R_OK) != 0)
{
g_free (filename);
g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_ACCES,
......
......@@ -22,22 +22,23 @@
#include "config.h"
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#ifdef HAVE_SYS_PARAM_H
#include <sys/param.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <glib-object.h>
#include <glib/gstdio.h>
#ifdef G_OS_WIN32
#include <io.h>
#define W_OK 2
#define access(f,p) _access(f,p)
#endif
#include "core/core-types.h"
......@@ -110,7 +111,7 @@ file_save (GimpImage *gimage,
goto out;
}
if (access (filename, W_OK) != 0)
if (g_access (filename, W_OK) != 0)
{
g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_ACCES,
g_strerror (errno));
......
......@@ -39,9 +39,8 @@
#include <sys/stat.h>
#include <fcntl.h>
#include <glib/gstdio.h>
#include <glib-object.h>
#include <glib/gstdio.h>
#ifndef G_OS_WIN32 /* This code doesn't compile on win32 and the use of
* the freedesktop standard doesn't make much sense
......@@ -544,7 +543,7 @@ gimp_recent_list_add_item (GimpRecentItem *item)
if (fd < 0)
{
fd = creat (filename, S_IRUSR | S_IWUSR);
fd = g_creat (filename, S_IRUSR | S_IWUSR);
created = TRUE;
}
......
......@@ -140,7 +140,7 @@ gimp_config_writer_new_file (const gchar *filename,
}
else
{
fd = creat (filename, 0644);
fd = g_creat (filename, 0644);
if (fd == -1)
{
......
......@@ -929,7 +929,7 @@ gimp_thumbnail_save (GimpThumbnail *thumbnail,
g_printerr ("temporary thumbnail file renamed to %s\n", filename);
#endif
success = (chmod (filename, 0600) == 0);
success = (g_chmod (filename, 0600) == 0);
if (! success)
g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (errno),
......@@ -1300,7 +1300,7 @@ gimp_thumbnail_save_failure (GimpThumbnail *thumbnail,
NULL);
if (success)
{
success = (chmod (name, 0600) == 0);
success = (g_chmod (name, 0600) == 0);
if (success)
gimp_thumbnail_update_thumb (thumbnail, GIMP_THUMB_SIZE_NORMAL);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment