| // RUN: %check_clang_tidy %s android-cloexec-creat %t |
| extern "C" int creat(const char *path, mode_t, ...); |
| extern "C" int create(const char *path, mode_t, ...); |
| // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: prefer open() to creat() because open() allows O_CLOEXEC [android-cloexec-creat] |
| // CHECK-FIXES: open ("filename", O_WRONLY | O_CREAT | O_TRUNC | O_CLOEXEC, 0); |
| // CHECK-MESSAGES-NOT: warning: |
| // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: |
| // CHECK-FIXES: open ("filename", O_WRONLY | O_CREAT | O_TRUNC | O_CLOEXEC, mode); |
| int creat(const char *path, mode_t, ...); |
| // CHECK-MESSAGES-NOT: warning: |
| int creat(const char *path, mode_t, ...); |
| // CHECK-MESSAGES-NOT: warning: |