diff options
author | Michel Dänzer <[email protected]> | 2020-02-18 19:04:00 +0100 |
---|---|---|
committer | Michel Dänzer <[email protected]> | 2020-02-21 17:10:48 +0100 |
commit | f5a8958910f53d924d062cbf024cebe4134f757a (patch) | |
tree | 3f7234ce1e9d46766768fc0b912dce2b895c97a8 /src/util/os_file.h | |
parent | 228cbdfe67e465dc79558fc76a51d8115251b5e5 (diff) |
util: Change os_same_file_description return type from bool to int
This allows communicating that it wasn't possible to determine whether
the two file descriptors reference the same file description. When
that's the case, log a warning in the amdgpu winsys.
In turn, remove the corresponding debugging output from the fallback
os_same_file_description implementation. It depends on the caller if
false negatives are problematic or not.
Reviewed-by: Eric Engestrom <[email protected]>
Reviewed-by: Marek Olšák <[email protected]>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3879>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3879>
Diffstat (limited to 'src/util/os_file.h')
-rw-r--r-- | src/util/os_file.h | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/util/os_file.h b/src/util/os_file.h index 1972beba32b..58639476f60 100644 --- a/src/util/os_file.h +++ b/src/util/os_file.h @@ -32,10 +32,14 @@ char * os_read_file(const char *filename); /* - * Returns true if the two file descriptors passed in can be determined to - * reference the same file description, false otherwise + * Try to determine if two file descriptors reference the same file description + * + * Return values: + * - 0: They reference the same file description + * - > 0: They do not reference the same file description + * - < 0: Unable to determine whether they reference the same file description */ -bool +int os_same_file_description(int fd1, int fd2); #ifdef __cplusplus |