public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Rasmus Villemoes <rv@rasmusvillemoes.dk>
To: libc-alpha@sourceware.org
Subject: [PATCH] Use mode_t in open and friends
Date: Thu, 24 Apr 2014 11:26:00 -0000	[thread overview]
Message-ID: <87k3afhsua.fsf@rasmusvillemoes.dk> (raw)

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


             reply	other threads:[~2014-04-24 11:26 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-24 11:26 Rasmus Villemoes [this message]
2014-04-24 12:30 ` Andreas Schwab
2014-04-24 13:06   ` Rasmus Villemoes
2014-04-24 14:07     ` Paul Eggert
2014-04-25 18:42       ` Rich Felker
2014-05-03  9:28   ` Ondřej Bílka
2014-05-03 16:52     ` Pedro Alves
2014-05-06 19:54       ` Rasmus Villemoes
2014-05-16 20:49         ` Ondřej Bílka
2014-05-19 22:40           ` [PATCH v2] Handle possible vararg promotion of " Rasmus Villemoes
2014-08-02 15:53             ` Mike Frysinger
2014-08-03 12:25               ` Rasmus Villemoes
2014-08-03 13:27                 ` Mike Frysinger
2014-08-03 14:55                   ` [PATCH v3] " Rasmus Villemoes
2015-03-15  6:53                     ` Mike Frysinger
2014-08-03 15:47 ` [PATCH] Use " Mike Frysinger
2014-08-03 15:57   ` Rasmus Villemoes
2014-08-04  0:32     ` Mike Frysinger
2014-09-02 16:28       ` Rasmus Villemoes
2014-09-05  8:21         ` Rasmus Villemoes

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87k3afhsua.fsf@rasmusvillemoes.dk \
    --to=rv@rasmusvillemoes.dk \
    --cc=libc-alpha@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).