aboutsummaryrefslogtreecommitdiff
path: root/package/tpm-tools/0001-tpm_nvread-include-sys-stat.h-for-open-modes.patch
blob: 35fd7632bd1df6e369e86b3440fb2f19485c91dd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
From 5fedfd32a226e3ac8a6022227ec2d8fc6df26901 Mon Sep 17 00:00:00 2001
From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Date: Thu, 24 Dec 2015 08:57:09 +0100
Subject: [PATCH] tpm_nvread: include <sys/stat.h> for open() modes

As the manual page of open(2) indicates, the <sys/stat.h> header
should be included. Indeed, it is this header that provides the mode_t
macros such as S_IRUSR and S_IWUSR.

While the build happens to work with glibc without this included
header, it fails with other C libraries such as uClibc, due to the
missing inclusion.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 src/tpm_mgmt/tpm_nvread.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/tpm_mgmt/tpm_nvread.c b/src/tpm_mgmt/tpm_nvread.c
index 35fe17c..92f047c 100644
--- a/src/tpm_mgmt/tpm_nvread.c
+++ b/src/tpm_mgmt/tpm_nvread.c
@@ -23,6 +23,7 @@
 #include <ctype.h>
 #include <fcntl.h>
 #include <unistd.h>
+#include <sys/stat.h>
 
 #include "tpm_nvcommon.h"
 #include "tpm_tspi.h"
-- 
2.6.4