Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
liblongpath-rsync
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
liblongpath
liblongpath-rsync
Commits
1ff5450d
Commit
1ff5450d
authored
May 26, 1998
by
Andrew Tridgell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
formatting changes
parent
2f7512b0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
34 deletions
+35
-34
main.c
main.c
+35
-34
No files found.
main.c
View file @
1ff5450d
...
...
@@ -148,40 +148,41 @@ static char *get_local_name(struct file_list *flist,char *name)
STRUCT_STAT
st
;
extern
int
orig_umask
;
if
(
do_stat
(
name
,
&
st
)
==
0
)
{
if
(
S_ISDIR
(
st
.
st_mode
))
{
if
(
chdir
(
name
)
!=
0
)
{
rprintf
(
FERROR
,
"chdir %s : %s (1)
\n
"
,
name
,
strerror
(
errno
));
exit_cleanup
(
1
);
}
return
NULL
;
}
if
(
flist
->
count
>
1
)
{
rprintf
(
FERROR
,
"ERROR: destination must be a directory when copying more than 1 file
\n
"
);
exit_cleanup
(
1
);
}
return
name
;
}
if
(
flist
->
count
==
1
)
return
name
;
if
(
!
name
)
return
NULL
;
if
(
do_mkdir
(
name
,
0777
&
~
orig_umask
)
!=
0
)
{
rprintf
(
FERROR
,
"mkdir %s : %s (1)
\n
"
,
name
,
strerror
(
errno
));
exit_cleanup
(
1
);
}
else
{
rprintf
(
FINFO
,
"created directory %s
\n
"
,
name
);
}
if
(
chdir
(
name
)
!=
0
)
{
rprintf
(
FERROR
,
"chdir %s : %s (2)
\n
"
,
name
,
strerror
(
errno
));
exit_cleanup
(
1
);
}
return
NULL
;
if
(
do_stat
(
name
,
&
st
)
==
0
)
{
if
(
S_ISDIR
(
st
.
st_mode
))
{
if
(
chdir
(
name
)
!=
0
)
{
rprintf
(
FERROR
,
"chdir %s : %s (1)
\n
"
,
name
,
strerror
(
errno
));
exit_cleanup
(
1
);
}
return
NULL
;
}
if
(
flist
->
count
>
1
)
{
rprintf
(
FERROR
,
"ERROR: destination must be a directory when copying more than 1 file
\n
"
);
exit_cleanup
(
1
);
}
return
name
;
}
if
(
flist
->
count
==
1
)
return
name
;
if
(
!
name
)
return
NULL
;
if
(
do_mkdir
(
name
,
0777
&
~
orig_umask
)
!=
0
)
{
rprintf
(
FERROR
,
"mkdir %s : %s (1)
\n
"
,
name
,
strerror
(
errno
));
exit_cleanup
(
1
);
}
else
{
rprintf
(
FINFO
,
"created directory %s
\n
"
,
name
);
}
if
(
chdir
(
name
)
!=
0
)
{
rprintf
(
FERROR
,
"chdir %s : %s (2)
\n
"
,
name
,
strerror
(
errno
));
exit_cleanup
(
1
);
}
return
NULL
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment