From 9c72f81a216fdb05826b3dfc084b11fddf373702 Mon Sep 17 00:00:00 2001 From: Pavel Roskin Date: Fri, 24 Oct 2003 18:38:02 +0000 Subject: [PATCH] * chmod.c (stat_file): Eliminate. Use mc_stat(). * chmod.h: Remove unneded code. * chown.h: Likewise. * main.c: Include achown.h. --- src/ChangeLog | 5 +++++ src/achown.c | 4 ++-- src/chmod.c | 12 ++---------- src/chmod.h | 3 --- src/chown.c | 2 +- src/chown.h | 3 --- src/main.c | 1 + 7 files changed, 11 insertions(+), 19 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 3700565a5..66d27c10f 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,10 @@ 2003-10-24 Pavel Roskin + * chmod.c (stat_file): Eliminate. Use mc_stat(). + * chmod.h: Remove unneded code. + * chown.h: Likewise. + * main.c: Include achown.h. + * fileopctx.h: Define struct FileOpContext. * background.h: Avoid conditional declarations. diff --git a/src/achown.c b/src/achown.c index 2879654d8..987735b06 100644 --- a/src/achown.c +++ b/src/achown.c @@ -617,7 +617,7 @@ static void apply_advanced_chowns (struct stat *sf) do { fname = next_file (); - if (!stat_file (fname, sf)) + if (mc_stat (fname, sf) != 0) break; ch_cmode = sf->st_mode; if (mc_chmod (fname, get_mode ()) == -1) @@ -646,7 +646,7 @@ chown_advanced_cmd (void) else fname = selection (cpanel)->fname; /* single file */ - if (!stat_file (fname, sf_stat)){ /* get status of file */ + if (mc_stat (fname, sf_stat) != 0) { /* get status of file */ destroy_dlg (ch_dlg); break; } diff --git a/src/chmod.c b/src/chmod.c index d4a0d9739..1979af826 100644 --- a/src/chmod.c +++ b/src/chmod.c @@ -219,14 +219,6 @@ init_chmod (void) return ch_dlg; } -int stat_file (char *filename, struct stat *st) -{ - if (mc_stat (filename, st)) - return 0; - - return 1; -} - static void chmod_done (void) { if (need_update) @@ -262,7 +254,7 @@ static void apply_mask (struct stat *sf) do { fname = next_file (); - if (!stat_file (fname, sf)) + if (mc_stat (fname, sf) != 0) return; c_stat = sf->st_mode; @@ -285,7 +277,7 @@ void chmod_cmd (void) else fname = selection (cpanel)->fname; /* single file */ - if (!stat_file (fname, &sf_stat)){ /* get status of file */ + if (mc_stat (fname, &sf_stat) != 0) { /* get status of file */ destroy_dlg (ch_dlg); break; } diff --git a/src/chmod.h b/src/chmod.h index a178d473d..71e51f2f2 100644 --- a/src/chmod.h +++ b/src/chmod.h @@ -1,7 +1,4 @@ #ifndef __CHMOD_H #define __CHMOD_H void chmod_cmd (void); -int stat_file (char *, struct stat *); -void ch1_cmd (int id); -void ch2_cmd (int id); #endif diff --git a/src/chown.c b/src/chown.c index ee2aac547..1083fde94 100644 --- a/src/chown.c +++ b/src/chown.c @@ -255,7 +255,7 @@ chown_cmd (void) else fname = selection (cpanel)->fname; /* single file */ - if (!stat_file (fname, &sf_stat)){ /* get status of file */ + if (mc_stat (fname, &sf_stat) != 0) { /* get status of file */ destroy_dlg (ch_dlg); break; } diff --git a/src/chown.h b/src/chown.h index f2ae18837..c02a914d8 100644 --- a/src/chown.h +++ b/src/chown.h @@ -1,7 +1,4 @@ #ifndef __CHOWN_H #define __CHOWN_H - void chown_cmd (void); -void chown_advanced_cmd (void); - #endif diff --git a/src/main.c b/src/main.c index 8f5a6b2ab..b3c8916a8 100644 --- a/src/main.c +++ b/src/main.c @@ -75,6 +75,7 @@ #include "chmod.h" #include "chown.h" +#include "achown.h" #ifdef WITH_SMBFS #include "../vfs/smbfs.h" /* smbfs_set_debug() */