This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH] Use mode_t in open and friends
- From: Rasmus Villemoes <rv at rasmusvillemoes dot dk>
- To: libc-alpha at sourceware dot org
- Date: Thu, 24 Apr 2014 13:25:49 +0200
- Subject: [PATCH] Use mode_t in open and friends
- Authentication-results: sourceware.org; auth=none
The sole varargs argument to open and friends has type mode_t, not int.
Signed-off-by: Rasmus Villemoes <rv@rasmusvillemoes.dk>
---
io/open.c | 4 ++--
io/open64.c | 4 ++--
io/openat.c | 4 ++--
io/openat64.c | 4 ++--
sysdeps/posix/open64.c | 4 ++--
sysdeps/unix/sysv/linux/generic/open.c | 8 ++++----
sysdeps/unix/sysv/linux/generic/open64.c | 4 ++--
sysdeps/unix/sysv/linux/open64.c | 4 ++--
8 files changed, 18 insertions(+), 18 deletions(-)
diff --git a/io/open.c b/io/open.c
index 24aa380..5be57a1 100644
--- a/io/open.c
+++ b/io/open.c
@@ -30,7 +30,7 @@ __libc_open (file, oflag)
const char *file;
int oflag;
{
- int mode;
+ mode_t mode;
if (file == NULL)
{
@@ -42,7 +42,7 @@ __libc_open (file, oflag)
{
va_list arg;
va_start(arg, oflag);
- mode = va_arg(arg, int);
+ mode = va_arg(arg, mode_t);
va_end(arg);
}
diff --git a/io/open64.c b/io/open64.c
index 3f3d2e8..b740ab6 100644
--- a/io/open64.c
+++ b/io/open64.c
@@ -28,7 +28,7 @@ __libc_open64 (file, oflag)
const char *file;
int oflag;
{
- int mode;
+ mode_t mode;
if (file == NULL)
{
@@ -40,7 +40,7 @@ __libc_open64 (file, oflag)
{
va_list arg;
va_start (arg, oflag);
- mode = va_arg (arg, int);
+ mode = va_arg (arg, mode_t);
va_end (arg);
}
diff --git a/io/openat.c b/io/openat.c
index 2d82270..aac603c 100644
--- a/io/openat.c
+++ b/io/openat.c
@@ -38,7 +38,7 @@ __openat (fd, file, oflag)
const char *file;
int oflag;
{
- int mode;
+ mode_t mode;
if (file == NULL)
{
@@ -64,7 +64,7 @@ __openat (fd, file, oflag)
{
va_list arg;
va_start (arg, oflag);
- mode = va_arg (arg, int);
+ mode = va_arg (arg, mode_t);
va_end (arg);
}
diff --git a/io/openat64.c b/io/openat64.c
index c0c4e19..1f126fc 100644
--- a/io/openat64.c
+++ b/io/openat64.c
@@ -31,7 +31,7 @@ __openat64 (fd, file, oflag)
const char *file;
int oflag;
{
- int mode;
+ mode_t mode;
if (file == NULL)
{
@@ -57,7 +57,7 @@ __openat64 (fd, file, oflag)
{
va_list arg;
va_start (arg, oflag);
- mode = va_arg (arg, int);
+ mode = va_arg (arg, mode_t);
va_end (arg);
}
diff --git a/sysdeps/posix/open64.c b/sysdeps/posix/open64.c
index 64d192a..9364454 100644
--- a/sysdeps/posix/open64.c
+++ b/sysdeps/posix/open64.c
@@ -24,13 +24,13 @@
int
__libc_open64 (const char *file, int oflag, ...)
{
- int mode = 0;
+ mode_t mode = 0;
if (oflag & O_CREAT)
{
va_list arg;
va_start (arg, oflag);
- mode = va_arg (arg, int);
+ mode = va_arg (arg, mode_t);
va_end (arg);
}
diff --git a/sysdeps/unix/sysv/linux/generic/open.c b/sysdeps/unix/sysv/linux/generic/open.c
index 4f73fa0..d243933 100644
--- a/sysdeps/unix/sysv/linux/generic/open.c
+++ b/sysdeps/unix/sysv/linux/generic/open.c
@@ -27,13 +27,13 @@
int
__libc_open (const char *file, int oflag, ...)
{
- int mode = 0;
+ mode_t mode = 0;
if (oflag & O_CREAT)
{
va_list arg;
va_start (arg, oflag);
- mode = va_arg (arg, int);
+ mode = va_arg (arg, mode_t);
va_end (arg);
}
@@ -57,13 +57,13 @@ weak_alias (__libc_open, open)
int
__open_nocancel (const char *file, int oflag, ...)
{
- int mode = 0;
+ mode_t mode = 0;
if (oflag & O_CREAT)
{
va_list arg;
va_start (arg, oflag);
- mode = va_arg (arg, int);
+ mode = va_arg (arg, mode_t);
va_end (arg);
}
diff --git a/sysdeps/unix/sysv/linux/generic/open64.c b/sysdeps/unix/sysv/linux/generic/open64.c
index 93d79e3..e367e12 100644
--- a/sysdeps/unix/sysv/linux/generic/open64.c
+++ b/sysdeps/unix/sysv/linux/generic/open64.c
@@ -27,13 +27,13 @@
int
__libc_open64 (const char *file, int oflag, ...)
{
- int mode = 0;
+ mode_t mode = 0;
if (oflag & O_CREAT)
{
va_list arg;
va_start (arg, oflag);
- mode = va_arg (arg, int);
+ mode = va_arg (arg, mode_t);
va_end (arg);
}
diff --git a/sysdeps/unix/sysv/linux/open64.c b/sysdeps/unix/sysv/linux/open64.c
index 0d63806..442a2ef 100644
--- a/sysdeps/unix/sysv/linux/open64.c
+++ b/sysdeps/unix/sysv/linux/open64.c
@@ -26,13 +26,13 @@
int
__libc_open64 (const char *file, int oflag, ...)
{
- int mode = 0;
+ mode_t mode = 0;
if (oflag & O_CREAT)
{
va_list arg;
va_start (arg, oflag);
- mode = va_arg (arg, int);
+ mode = va_arg (arg, mode_t);
va_end (arg);
}
--
1.8.4.rc3.2.g61bff3f