tests: Fix libroot flock pointer size on non-32bit platforms
This commit is contained in:
@@ -8,6 +8,7 @@
|
|||||||
|
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#include <stdint.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
@@ -19,7 +20,7 @@ bool gDone = false;
|
|||||||
static int32
|
static int32
|
||||||
try_to_lock(void *_fd)
|
try_to_lock(void *_fd)
|
||||||
{
|
{
|
||||||
int fd = (int)_fd;
|
intptr_t fd = (intptr_t)_fd;
|
||||||
|
|
||||||
struct flock flock = {
|
struct flock flock = {
|
||||||
F_RDLCK, // shared lock
|
F_RDLCK, // shared lock
|
||||||
@@ -60,7 +61,7 @@ try_to_lock(void *_fd)
|
|||||||
int
|
int
|
||||||
main(int argc, char **argv)
|
main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
int fd = open("/bin/sh", O_RDONLY);
|
intptr_t fd = open("/bin/sh", O_RDONLY);
|
||||||
if (fd < 0) {
|
if (fd < 0) {
|
||||||
fprintf(stderr, "could not open file: %s\n", strerror(errno));
|
fprintf(stderr, "could not open file: %s\n", strerror(errno));
|
||||||
return -1;
|
return -1;
|
||||||
|
|||||||
Reference in New Issue
Block a user