Bug 6848 - source/client/mtab.c uses defines from sys/stat.h but doesnt include the header
Summary: source/client/mtab.c uses defines from sys/stat.h but doesnt include the header
Status: RESOLVED FIXED
Alias: None
Product: Samba 3.4
Classification: Unclassified
Component: Client Tools (show other bugs)
Version: unspecified
Hardware: Other Linux
: P3 normal
Target Milestone: ---
Assignee: Volker Lendecke
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-10-27 03:53 UTC by Mike Frysinger
Modified: 2010-09-20 23:24 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Frysinger 2009-10-27 03:53:50 UTC
this issue applies to latest git, samba-3.4.2, and probably older.

the client/mtab.c file does things like:
    i = open (linktargetfile, O_WRONLY|O_CREAT, S_IRUSR|S_IWUSR);

the S_xxx defines come from sys/stat.h, but mtab.c never includes it.  thus we easily hit errors like so:
Compiling client/mtab.c
../samba-3.4.2/source3/client/mtab.c: In function ‘lock_mtab’:
../samba-3.4.2/source3/client/mtab.c:142: error: ‘S_IRUSR’ undeclared (first use in this function)
../samba-3.4.2/source3/client/mtab.c:142: error: (Each undeclared identifier is reported only once
../samba-3.4.2/source3/client/mtab.c:142: error: for each function it appears in.)
../samba-3.4.2/source3/client/mtab.c:142: error: ‘S_IWUSR’ undeclared (first use in this function)
Comment 1 Mike Frysinger 2009-10-27 04:38:38 UTC
sorry, "latest git" is probably wrong.  i had the wrong branch checked out locally and so was looking at much older source.
Comment 2 Volker Lendecke 2010-09-20 23:24:07 UTC
Closing as fixed. client/mtab.c has gone from current source. If you have different compile problems, please feel free to open another bug.

Volker