Skip to content

Commit fb72018

Browse files
committed
Fix work under BSD.
1 parent 30845bf commit fb72018

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

dir.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,21 +38,17 @@ int
3838
dir_create_dir(const char *dir, mode_t mode)
3939
{
4040
char copy[MAXPGPATH];
41-
char *parent;
41+
char parent[MAXPGPATH];
4242

4343
strncpy(copy, dir, MAXPGPATH);
44-
parent = dirname(copy);
44+
strncpy(parent, dirname(copy), MAXPGPATH);
4545

4646
/* Create parent first */
4747
if (access(parent, F_OK) == -1)
4848
dir_create_dir(parent, mode);
4949

5050
/* Create directory */
51-
#ifdef __darwin__
52-
if (mkdir(copy, mode) == -1)
53-
#else
5451
if (mkdir(dir, mode) == -1)
55-
#endif
5652
{
5753
if (errno == EEXIST) /* already exist */
5854
return 0;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy