Skip to contentSkip to conversation

drm: Fix compilation on systems that don't provide O_CLOEXEC

PATCH In review Stefan Dirsch 3 participants 5 messages Apr 20, 2016 – Apr 21, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm: Fix compilation on systems that don't provide O_CLOEXEC

Patch suggestion by Thomas Klausner. See also
http://mail-index.netbsd.org/pkgsrc-changes/2012/08/13/msg076887.html

---
 include/drm/drm.h | 4 ++++
 1 file changed, 4 insertions(+)
include/drm/drm.h +4 -0
index b4ebaa9..739df01 100644
@@ -674,7 +674,11 @@ struct drm_set_client_cap {
 };
 
 #define DRM_RDWR O_RDWR
+#ifdef O_CLOEXEC
 #define DRM_CLOEXEC O_CLOEXEC
+#else
+#define DRM_CLOEXEC 0
+#endif
 struct drm_prime_handle {
 	__u32 handle;
 
Signature · 6 lines
2.6.2

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#1 lore raw
Quoted 4 lines · Stefan Dirsch

Patch suggestion by Thomas Klausner. See also
http://mail-index.netbsd.org/pkgsrc-changes/2012/08/13/msg076887.html

Fix your OS to have O_CLOEXEC semantics I think is what should happen here. It's an obvious race in multi-threaded apps, and you need a fix for it anyway.
-Daniel

Quoted 27 lines
---
 include/drm/drm.h | 4 ++++
 1 file changed, 4 insertions(+)
include/drm/drm.h +4 -1
index b4ebaa9..739df01 100644
@@ -674,7 +674,11 @@ struct drm_set_client_cap {
 };
 
 #define DRM_RDWR O_RDWR
+#ifdef O_CLOEXEC
 #define DRM_CLOEXEC O_CLOEXEC
+#else
+#define DRM_CLOEXEC 0
+#endif
 struct drm_prime_handle {
        __u32 handle;
 
--

2.6.2

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#2 lore raw
Quoted 10 lines · Daniel Vetter
Quoted 4 lines · Stefan Dirsch

Patch suggestion by Thomas Klausner. See also
http://mail-index.netbsd.org/pkgsrc-changes/2012/08/13/msg076887.html

Fix your OS to have O_CLOEXEC semantics I think is what should happen here. It's an obvious race in multi-threaded apps, and you need a fix for it anyway.
-Daniel

Indeed I figured out the patch is no longer needed and finally removed it. ;-)

Thanks,
Stefan

Public Key available
------------------------------------------------------

Stefan Dirsch (Res. & Dev.)   SUSE LINUX GmbH
Tel: 0911-740 53 0            Maxfeldstraße 5
FAX: 0911-740 53 479          D-90409 Nürnberg
http://www.suse.de            Germany 

---------------------------------------------------------------
SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg)
---------------------------------------------------------------
_______________________________________________
dri-devel mailing list [email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#3 lore raw
Quoted 5 lines · Stefan Dirsch
Quoted 4 lines · Daniel Vetter
Quoted 3 lines · Stefan Dirsch

Patch suggestion by Thomas Klausner. See also
http://mail-index.netbsd.org/pkgsrc-changes/2012/08/13/msg076887.html

Quoted 9 lines
Quoted 6 lines
Quoted 1 line

Fix your OS to have O_CLOEXEC semantics I think is what should happen here. It's an obvious race in multi-threaded apps, and you need a fix for it anyway.
-Daniel

Indeed I figured out the patch is no longer needed and finally removed it. ;-)

No problem Stefan and thanks for starting to get the Suse patches upstreamed.

A few friendly suggestions - please correctly the patch author (if not yourself) and don't add their s-o-b unless they have done/agreed so.

Thanks,
Emil

P.S. [Note to self~ish~] Perhaps it's time we unconditionally use O_CLOEXEC in mesa...
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#4 lore raw
Quoted 8 lines · Emil Velikov
Quoted 7 lines · Stefan Dirsch
Quoted 6 lines · Daniel Vetter
Quoted 4 lines · Stefan Dirsch

Patch suggestion by Thomas Klausner. See also
http://mail-index.netbsd.org/pkgsrc-changes/2012/08/13/msg076887.html

Quoted 8 lines
Quoted 7 lines
Quoted 4 lines

Fix your OS to have O_CLOEXEC semantics I think is what should happen here. It's an obvious race in multi-threaded apps, and you need a fix for it anyway.
-Daniel

Indeed I figured out the patch is no longer needed and finally removed it. ;-)

No problem Stefan and thanks for starting to get the Suse patches upstreamed.

You're welcome. I'm trying my best. ;-)

Quoted 2 lines

A few friendly suggestions - please correctly the patch author (if not yourself) and don't add their s-o-b unless they have done/agreed so.

Fixed and resent. ;-)

Thanks,
Stefan

Public Key available
------------------------------------------------------

Stefan Dirsch (Res. & Dev.)   SUSE LINUX GmbH
Tel: 0911-740 53 0            Maxfeldstraße 5
FAX: 0911-740 53 479          D-90409 Nürnberg
http://www.suse.de            Germany 

---------------------------------------------------------------
SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg)
---------------------------------------------------------------
_______________________________________________
dri-devel mailing list [email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel