dtfile: resolve 19 compiler warnings.

This commit is contained in:
Peter Howkins
2015-01-09 16:16:53 +00:00
parent 561d858140
commit 22830f478a
4 changed files with 38 additions and 19 deletions

View File

@@ -704,10 +704,14 @@ WriteTrashEntries( void )
/* Remove the original information file, and move the new one */
(void) fclose(newFile);
(void) chown(NewTrashInfoFileName, getuid(), getgid());
if(-1 == chown(NewTrashInfoFileName, getuid(), getgid())) {
return( False );
}
(void) remove(TrashInfoFileName);
(void) rename(NewTrashInfoFileName, TrashInfoFileName);
(void) chown(TrashInfoFileName, getuid(), getgid());
if(-1 == chown(TrashInfoFileName, getuid(), getgid())) {
return( False );
}
return( True );
}
else
@@ -2830,7 +2834,7 @@ MoveToTrashProcess(
to = CreateTrashFilename(baseName, TRUE);
/* move file to the trash directory */
success = FileManip((Widget)pipe_fd, MOVE_FILE, path, to, TRUE,
success = FileManip((Widget) (intptr_t) pipe_fd, MOVE_FILE, path, to, TRUE,
FileOpError, True, TRASH_DIRECTORY);
if (success)
{
@@ -3366,7 +3370,12 @@ MoveToTrash(
#endif /* SUN_PERF */
/* create a pipe */
pipe(pipe_fd);
if(-1 == pipe(pipe_fd)) {
fprintf(stderr,
"%s: pipe failed error %d=%s\n",
pname, errno, strerror(errno));
return;
}
/* fork the process that does the actual work */
pid = fork();
@@ -3512,7 +3521,7 @@ RestoreProcess(
if (to != NULL)
{
status = RestoreObject((Widget)pipe_fd, MOVE_FILE, from,to,
status = RestoreObject((Widget) (intptr_t) pipe_fd, MOVE_FILE, from,to,
TRUE, FileOpError, False, NOT_DESKTOP,CheckedAlready);
/* restore was successful */
if(status == (int) True)
@@ -3756,7 +3765,12 @@ RestoreFromTrash(
cb_data->msg = msg;
/* create a pipe */
pipe(pipe_fd);
if(-1 == pipe(pipe_fd)) {
fprintf(stderr,
"%s: pipe failed, error %d=%s\n",
pname, errno, strerror(errno));
return;
}
/* fork the process that does the actual work */
pid = fork();
@@ -4076,7 +4090,12 @@ EmptyTrash(
cb_data->msg = msg;
/* create a pipe */
pipe(pipe_fd);
if(-1 == pipe(pipe_fd)) {
fprintf(stderr,
"%s: pipe failed, error %d=%s\n",
pname, errno, strerror(errno));
return;
}
/* fork the process that does the actual work */
pid = fork();