Bug 9548 - O_DIRECT detection is broken in configure
O_DIRECT detection is broken in configure
Status: RESOLVED FIXED
Product: Samba 3.6
Classification: Unclassified
Component: Build environment
3.6.10
All FreeBSD
: P5 normal
: ---
Assigned To: Karolin Seeger
Samba QA Contact
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-01-07 20:26 UTC by Mikhail T.
Modified: 2013-01-16 08:51 UTC (History)
0 users

See Also:


Attachments
Patch for 3.6 (1.80 KB, patch)
2013-01-12 17:44 UTC, Volker Lendecke
jra: review+
Details
Patch for master (2.76 KB, patch)
2013-01-12 17:45 UTC, Volker Lendecke
jra: review+
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mikhail T. 2013-01-07 20:26:14 UTC
The check for O_DIRECT uses the following conftest.c:

#Long list of defines

#include <unistd.h>
#ifdef HAVE_FCNTL_H
#include <fcntl.h>
#endif
int
main ()
{
int fd = open("/dev/null", O_DIRECT);
  ;
  return 0;
}

Unfortunately, the knob HAVE_FCNTL_H is not part of the long list of defines -- the check for the presence of fcntl.h happens later in the configure script.

So <fcntl.h> does not get included and O_DIRECT remains undefined, even when the OS supports it. It is possible, other flags are similarly misdiagnosed as well.
Comment 1 Volker Lendecke 2013-01-12 17:44:29 UTC
Created attachment 8413 [details]
Patch for 3.6

This fixes it for me
Comment 2 Volker Lendecke 2013-01-12 17:45:44 UTC
Created attachment 8414 [details]
Patch for master

Jeremy, if it does it for you as well, please push to master. The patch also applies to 4.0 with some auto-merging messages, so it should be good for v4-0-test
Comment 3 Jeremy Allison 2013-01-14 18:37:56 UTC
Comment on attachment 8414 [details]
Patch for master

Applies to 4.0.x using "patch" command, not with git am (for me).
Comment 4 Volker Lendecke 2013-01-14 19:46:38 UTC
(In reply to comment #3)
> Comment on attachment 8414 [details]
> Patch for master
> 
> Applies to 4.0.x using "patch" command, not with git am (for me).

Just out of curiosity: Did you try "git am -3"?
Comment 5 Jeremy Allison 2013-01-14 20:01:08 UTC
Oh no - didn't know about git am -3.

Thanks for the tip !

Jeremy.
Comment 6 Jeremy Allison 2013-01-14 20:02:48 UTC
Comment on attachment 8413 [details]
Patch for 3.6

LGTM.
Comment 7 Jeremy Allison 2013-01-14 20:06:30 UTC
Re-assigning to Karolin for inclusion in 3.6.next and 4.0.next.
Jeremy.
Comment 8 Karolin Seeger 2013-01-15 10:22:30 UTC
Pushed to v3-6-test and autobuild-v4-0-test.
Comment 9 Karolin Seeger 2013-01-16 08:51:43 UTC
Pushed to v4-0-test.
Closing out bug report.

Thanks!