projects
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
913e029
)
nir/spirv: add some error checking to open()
author
Eric Engestrom
<eric@engestrom.ch>
Sun, 25 Sep 2016 15:49:50 +0000
(16:49 +0100)
committer
Jason Ekstrand
<jason.ekstrand@intel.com>
Sat, 1 Oct 2016 22:27:31 +0000
(15:27 -0700)
CovID:
1373369
Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/compiler/spirv/spirv2nir.c
patch
|
blob
|
history
diff --git
a/src/compiler/spirv/spirv2nir.c
b/src/compiler/spirv/spirv2nir.c
index c837186bdfce56605dcb26cdc0d3b25dd0e11446..d151c2cc8285e4e9917997775f3a5f4ed18d35ae 100644
(file)
--- a/
src/compiler/spirv/spirv2nir.c
+++ b/
src/compiler/spirv/spirv2nir.c
@@
-37,10
+37,17
@@
#include <sys/types.h>
#include <fcntl.h>
#include <unistd.h>
+#include <stdio.h>
int main(int argc, char **argv)
{
int fd = open(argv[1], O_RDONLY);
+ if (fd < 0)
+ {
+ fprintf(stderr, "Failed to open %s\n", argv[1]);
+ return 1;
+ }
+
off_t len = lseek(fd, 0, SEEK_END);
assert(len % 4 == 0);
@@
-52,4
+59,6
@@
int main(int argc, char **argv)
nir_function *func = spirv_to_nir(map, word_count, NULL, 0,
MESA_SHADER_FRAGMENT, "main", NULL);
nir_print_shader(func->shader, stderr);
+
+ return 0;
}