summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorSamba Release Account <samba-bugs@samba.org>1997-07-02 01:19:41 +0000
committerSamba Release Account <samba-bugs@samba.org>1997-07-02 01:19:41 +0000
commit594f8a43610e0407f6842f76c8d80e180e7daed4 (patch)
treed2953de17c46a518aa7cd74c45b6d89fadd60381 /source3
parent991765ba60423c1fc07d81d94a64d88ee7b03ef4 (diff)
downloadsamba-594f8a43610e0407f6842f76c8d80e180e7daed4.tar.gz
samba-594f8a43610e0407f6842f76c8d80e180e7daed4.tar.bz2
samba-594f8a43610e0407f6842f76c8d80e180e7daed4.zip
Fixed compile warnings for FreeBsd & Linux.
Jeremy (jallison@whistle.com). (This used to be commit 93352e1aae9a1af7036cf56da820356cefe3698b)
Diffstat (limited to 'source3')
-rw-r--r--source3/smbd/quotas.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/source3/smbd/quotas.c b/source3/smbd/quotas.c
index a1d29bcd12..e6a6f61568 100644
--- a/source3/smbd/quotas.c
+++ b/source3/smbd/quotas.c
@@ -50,7 +50,6 @@ BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize)
{
uid_t euser_id;
int r;
- char dev_disk[256];
struct dqblk D;
struct stat S;
FILE *fp;
@@ -378,12 +377,12 @@ try to get the disk space from disk quotas - default version
****************************************************************************/
BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize)
{
- uid_t user_id, euser_id;
+ uid_t euser_id;
int r;
- char dev_disk[256];
struct dqblk D;
- struct stat S;
#ifndef __FreeBSD__
+ char dev_disk[256];
+ struct stat S;
/* find the block device file */
if ((stat(path, &S)<0) ||
(devnm(S_IFBLK, S.st_dev, dev_disk, 256, 0)<0)) return (False);
@@ -392,12 +391,16 @@ BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize)
euser_id = geteuid();
#ifdef USE_SETRES
- /* for HPUX, real uid must be same as euid to execute quotactl for euid */
- user_id = getuid();
- setresuid(euser_id,-1,-1);
- r=quotactl(Q_GETQUOTA, dev_disk, euser_id, &D);
- if (setresuid(user_id,-1,-1))
- DEBUG(5,("Unable to reset uid to %d\n", user_id));
+ {
+ uid_t user_id;
+
+ /* for HPUX, real uid must be same as euid to execute quotactl for euid */
+ user_id = getuid();
+ setresuid(euser_id,-1,-1);
+ r=quotactl(Q_GETQUOTA, dev_disk, euser_id, &D);
+ if (setresuid(user_id,-1,-1))
+ DEBUG(5,("Unable to reset uid to %d\n", user_id));
+ }
#else
#if defined(__FreeBSD__)
r= quotactl(path,Q_GETQUOTA,euser_id,(char *) &D);