mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Replace mkdir by g_mkdir for
increased cross-platform compatibility. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13541 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
7ce02733e8
commit
6ef3e79b63
@ -35,6 +35,7 @@
|
|||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
#include <glib/gi18n.h>
|
#include <glib/gi18n.h>
|
||||||
#include <glib/gprintf.h>
|
#include <glib/gprintf.h>
|
||||||
|
#include <glib/gstdio.h>
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@ -77,13 +78,13 @@ MakeHomeDir (void)
|
|||||||
* and not because its read-protected or other error.
|
* and not because its read-protected or other error.
|
||||||
* Go ahead and make it. Don't bother much with checking mkdir
|
* Go ahead and make it. Don't bother much with checking mkdir
|
||||||
* for errors; seems pointless. */
|
* for errors; seems pointless. */
|
||||||
mkdir (path, S_IRWXU); /* perms = S_IRWXU = 0700 */
|
g_mkdir (path, S_IRWXU); /* perms = S_IRWXU = 0700 */
|
||||||
}
|
}
|
||||||
|
|
||||||
data = g_strconcat (path, "/data", NULL);
|
data = g_strconcat (path, "/data", NULL);
|
||||||
rc = stat (data, &statbuf);
|
rc = stat (data, &statbuf);
|
||||||
if (rc)
|
if (rc)
|
||||||
mkdir (data, S_IRWXU);
|
g_mkdir (data, S_IRWXU);
|
||||||
|
|
||||||
g_free (path);
|
g_free (path);
|
||||||
g_free (data);
|
g_free (data);
|
||||||
@ -321,7 +322,7 @@ gnc_validate_directory (const gchar *dirname)
|
|||||||
if (rc) {
|
if (rc) {
|
||||||
switch (errno) {
|
switch (errno) {
|
||||||
case ENOENT:
|
case ENOENT:
|
||||||
rc = mkdir (dirname, S_IRWXU); /* perms = S_IRWXU = 0700 */
|
rc = g_mkdir (dirname, S_IRWXU); /* perms = S_IRWXU = 0700 */
|
||||||
if (rc) {
|
if (rc) {
|
||||||
g_fprintf(stderr,
|
g_fprintf(stderr,
|
||||||
_("An error occurred while creating the directory:\n"
|
_("An error occurred while creating the directory:\n"
|
||||||
|
Loading…
Reference in New Issue
Block a user