Skip to content

Add errno.h and print better error messages #3

@dominicgs

Description

@dominicgs

Adding errno.h and a bit better output on mount errors in /Hosts/GadgetFS_helpers.c

Output below from usb-mitm with this added helped me realize I wasn't root

include <errno.h>

if (status!=0) {fprintf(stderr,"Error mounting gadgetfs from [%s].\n",gadgetfs_path);fprintf(stderr, "Error code from mount is: [%s]\n", strerror(errno));return 1;}

debian@arm:/USBProxy/src$ ./usb-mitm
SIGRTMIN: 34
cleaning up /tmp
removing 0
Made directory /tmp/gadget-dVME7b for gadget
Error mounting gadgetfs from [/tmp/gadget-dVME7b].
Error code from mount is: [Operation not permitted]
Made directory /tmp/mqueue-Ovdyjh for mqueue
Error mounting mqueue at [/tmp/mqueue-Ovdyjh].
Unable to connect to device proxy.
Error unmounting gadgetfs from [/tmp/gadget-dVME7b].
done
debian@arm:
/USBProxy/src$

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions