Changeset 58143 in vbox for trunk/src/VBox/Additions/linux
- Timestamp:
- Oct 9, 2015 12:26:17 PM (9 years ago)
- Location:
- trunk/src/VBox/Additions/linux/sharedfolders
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/linux/sharedfolders/dirops.c
r57176 r58143 628 628 * @param dentry directory cache entry 629 629 * @param mode file mode 630 * @param excl Possible O_EXCL... 630 631 * @returns 0 on success, Linux error code otherwise 631 632 */ 632 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0) 633 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0) || defined(DOXYGEN_RUNNING) 633 634 static int sf_create(struct inode *parent, struct dentry *dentry, umode_t mode, bool excl) 634 635 #elif LINUX_VERSION_CODE >= KERNEL_VERSION(3, 3, 0) -
trunk/src/VBox/Additions/linux/sharedfolders/mount.vboxsf.c
r56675 r58143 1 /* $Id$ */ 1 2 /** @file 2 * vboxsf -- VirtualBox Guest Additions for Linux: mount(8) helper3 * VirtualBox Guest Additions for Linux - mount(8) helper. 3 4 * 4 5 * Parses options provided by mount (or user directly) … … 8 9 9 10 /* 10 * Copyright (C) 2006-201 2Oracle Corporation11 * Copyright (C) 2006-2015 Oracle Corporation 11 12 * 12 13 * This file is part of VirtualBox Open Source Edition (OSE), as … … 21 22 22 23 #ifndef _GNU_SOURCE 23 # define _GNU_SOURCE24 # define _GNU_SOURCE 24 25 #endif 25 26 26 27 /* #define DEBUG */ 27 #define DBG if (0)28 28 #include <errno.h> 29 29 #include <fcntl.h> … … 46 46 #include "vbsfmount.h" 47 47 48 /* Compile-time assertion. If a == 0, we get two identical switch cases, which is not 49 allowed. */ 50 #define CT_ASSERT(a) \ 51 do { \ 52 switch(0) { case 0: case (a): ; } \ 53 } while (0) 48 #include <iprt/assert.h> 49 54 50 55 51 #define PANIC_ATTR __attribute ((noreturn, __format__ (__printf__, 1, 2))) … … 129 125 int has_arg; 130 126 const char *desc; 131 } handlers[] 132 = 127 } handlers[] = 133 128 { 134 129 {"rw", HORW, 0, "mount read write (default)"}, … … 337 332 * Print out a usage message and exit. 338 333 * 339 * @param name The name of the application 334 * @returns 1 335 * @param argv0 The name of the application 340 336 */ 341 static void __attribute ((noreturn)) usage(char *name)337 static int usage(char *argv0) 342 338 { 343 339 printf("Usage: %s [OPTIONS] NAME MOUNTPOINT\n" … … 349 345 " -s sloppy parsing, ignore unrecognized mount options\n" 350 346 " -o OPTION[,OPTION...] use the mount options specified\n" 351 "\n", name);347 "\n", argv0); 352 348 printf("Available mount options are:\n" 353 349 " rw mount writable (the default)\n" … … 367 363 printf("Less common used options:\n" 368 364 " noexec,exec,nodev,dev,nosuid,suid\n"); 369 exit(1);365 return EXIT_FAILURE; 370 366 } 371 367 372 368 int 373 main 369 main(int argc, char **argv) 374 370 { 375 371 int c; … … 398 394 NULL, /* convertcp */ 399 395 }; 396 AssertCompile(sizeof(uid_t) == sizeof(int)); 397 AssertCompile(sizeof(gid_t) == sizeof(int)); 400 398 401 399 mntinf.nullchar = '\0'; … … 411 409 argv[0] = "mount.vboxsf"; 412 410 413 /* Compile-time assertions */414 CT_ASSERT(sizeof(uid_t) == sizeof(int));415 CT_ASSERT(sizeof(gid_t) == sizeof(int));416 417 411 while ((c = getopt(argc, argv, "rwsno:h")) != -1) 418 412 { … … 423 417 case '?': 424 418 case 'h': 425 usage(argv[0]);419 return usage(argv[0]); 426 420 427 421 case 'r': … … 447 441 448 442 if (argc - optind < 2) 449 usage(argv[0]);443 return usage(argv[0]); 450 444 451 445 host_name = argv[optind]; … … 551 545 exit(EXIT_SUCCESS); 552 546 } 547
Note:
See TracChangeset
for help on using the changeset viewer.