21792d7422f6dca8cd622a8cdf184c339533df35
[packages/trusty/cirros-testvm.git] / cirros-testvm / src-cirros / buildroot-2015.05 / package / wvstreams / 0004-build-fixes.patch
1 Add missing includes for proper build on Linux/glibc
2
3 The current wvstreams code doesn't build on Linux/glibc, with error
4 about chmod() not being available (for wvunixdgsocket.cc) or umask()
5 not being available (for wvatomicfile.cc). Those errors turn out to be
6 missing includes. Those includes were in fact already done, but
7 conditionally for MacOS. We make them unconditional (it probably
8 breaks other platforms, but since Buildroot is Linux only, we don't
9 care).
10
11 Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
12
13 Index: b/ipstreams/wvunixdgsocket.cc
14 ===================================================================
15 --- a/ipstreams/wvunixdgsocket.cc
16 +++ b/ipstreams/wvunixdgsocket.cc
17 @@ -1,8 +1,6 @@
18  #include "wvunixdgsocket.h"
19 -#ifdef MACOS
20  #include <sys/types.h>
21  #include <sys/stat.h>
22 -#endif
23  
24  WvUnixDGSocket::WvUnixDGSocket(WvStringParm filename, bool _server, int perms)
25      : socketfile(filename)
26 Index: b/streams/wvatomicfile.cc
27 ===================================================================
28 --- a/streams/wvatomicfile.cc
29 +++ b/streams/wvatomicfile.cc
30 @@ -10,10 +10,7 @@
31  #include "wvatomicfile.h"
32  #include "wvfileutils.h"
33  #include "wvstrutils.h"
34 -
35 -#ifdef MACOS
36  #include <sys/stat.h>
37 -#endif
38  
39  WvAtomicFile::WvAtomicFile(WvStringParm filename, int flags, mode_t create_mode)
40      : tmp_file(WvString::null)