Skip to content

Commit

Permalink
Tidy up includes and copyright notices, fix indentation
Browse files Browse the repository at this point in the history
The files not mentioned in changelog below had only
copyright notices fixes and indentation fixes.

* defs.h: Include <stdint.h> and <inttypes.h>.
* file.c: Do not include <inttypes.h>.
Move struct kernel_dirent declaration below top include block.
* block.c: Do not include <stdint.h> and <inttypes.h>.
* quota.c: Likewise.
* desc.c: Likewise.
* signal.c: Likewise.

Signed-off-by: Denys Vlasenko <[email protected]>
  • Loading branch information
Denys Vlasenko committed Mar 16, 2012
1 parent 27aeaa2 commit a6d91de
Show file tree
Hide file tree
Showing 55 changed files with 121 additions and 293 deletions.
2 changes: 0 additions & 2 deletions COPYRIGHT
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,3 @@ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

$Id$
4 changes: 1 addition & 3 deletions bjm.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,9 @@
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $Id$
*/
#include "defs.h"

#include "defs.h"
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/wait.h>
Expand Down
2 changes: 0 additions & 2 deletions block.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@
*/

#include "defs.h"
#include <stdint.h>
#include <inttypes.h>
#include <linux/blkpg.h>
#include <linux/fs.h>
#include <linux/hdreg.h>
Expand Down
2 changes: 0 additions & 2 deletions count.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $Id$
*/

#include "defs.h"
Expand Down
2 changes: 0 additions & 2 deletions debian/copyright
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,3 @@ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

$Id$
20 changes: 10 additions & 10 deletions defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $Id$
*/

#ifdef HAVE_CONFIG_H
Expand All @@ -42,23 +40,25 @@
# include <sgidefs.h>
#endif
#include <features.h>
#ifdef HAVE_STDBOOL_H
# include <stdbool.h>
#endif
#include <stdint.h>
#include <inttypes.h>
#include <sys/types.h>
#ifdef STDC_HEADERS
# include <stddef.h>
#endif
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <ctype.h>
#include <string.h>
#include <errno.h>
#include <signal.h>
#include <time.h>
#include <sys/time.h>
#include <errno.h>
#include <sys/syscall.h>
#ifdef HAVE_STDBOOL_H
# include <stdbool.h>
#endif
#ifdef STDC_HEADERS
# include <stddef.h>
#endif
#include <signal.h>

#ifndef HAVE_STRERROR
const char *strerror(int);
Expand Down
12 changes: 4 additions & 8 deletions desc.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,28 +26,24 @@
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $Id$
*/

#include "defs.h"

#include <fcntl.h>
#include <sys/file.h>
#include <inttypes.h>
#ifdef HAVE_SYS_EPOLL_H
#include <sys/epoll.h>
# include <sys/epoll.h>
#endif
#ifdef HAVE_LIBAIO_H
#include <libaio.h>
# include <libaio.h>
#endif

#if HAVE_LONG_LONG_OFF_T
/*
* Hacks for systems that have a long long off_t
*/
#define flock64 flock /* Horrid hack */
#define printflock printflock64 /* Horrider hack */
# define flock64 flock /* Horrid hack */
# define printflock printflock64 /* Horrider hack */
#endif

static const struct xlat fcntlcmds[] = {
Expand Down
2 changes: 0 additions & 2 deletions errnoent.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# $Id$

awk '
/^#define[ ]+E[A-Z0-9_]+[ ]+[0-9]+/ {
Expand Down
34 changes: 8 additions & 26 deletions file.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,12 @@
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $Id$
*/

#include "defs.h"

#include <dirent.h>
#include <sys/swap.h>

struct kernel_dirent {
unsigned long d_ino;
unsigned long d_off;
unsigned short d_reclen;
char d_name[1];
};

#ifdef LINUXSPARC
struct stat {
unsigned short st_dev;
Expand Down Expand Up @@ -92,7 +82,6 @@ struct stat_sparc64 {
# undef gid_t
# undef off_t
# undef loff_t

# define dev_t __kernel_dev_t
# define ino_t __kernel_ino_t
# define mode_t __kernel_mode_t
Expand All @@ -112,7 +101,6 @@ struct stat_sparc64 {
# undef gid_t
# undef off_t
# undef loff_t

# define dev_t dev_t
# define ino_t ino_t
# define mode_t mode_t
Expand All @@ -131,7 +119,7 @@ struct stat_sparc64 {
#include <sys/stat.h>
#undef stat
#undef stat64
/* These might be macros. */
/* These might be macros. */
#undef st_atime
#undef st_mtime
#undef st_ctime
Expand All @@ -140,35 +128,22 @@ struct stat_sparc64 {
#endif

#include <fcntl.h>

#ifdef HAVE_SYS_VFS_H
# include <sys/vfs.h>
#endif

#ifdef HAVE_LINUX_XATTR_H
# include <linux/xattr.h>
#else
# define XATTR_CREATE 1
# define XATTR_REPLACE 2
#endif

#if _LFS64_LARGEFILE
# ifdef HAVE_INTTYPES_H
# include <inttypes.h>
# else
# define PRId64 "lld"
# define PRIu64 "llu"
# endif
#endif

#if HAVE_LONG_LONG_OFF_T
/*
* Ugly hacks for systems that have typedef long long off_t
*/

# define stat64 stat
# define HAVE_STAT64 1 /* Ugly hack */

# define sys_stat64 sys_stat
# define sys_fstat64 sys_fstat
# define sys_lstat64 sys_lstat
Expand All @@ -189,6 +164,13 @@ struct stat_sparc64 {
# include <sys/asynch.h>
#endif

struct kernel_dirent {
unsigned long d_ino;
unsigned long d_off;
unsigned short d_reclen;
char d_name[1];
};

const struct xlat open_access_modes[] = {
{ O_RDONLY, "O_RDONLY" },
{ O_WRONLY, "O_WRONLY" },
Expand Down
5 changes: 1 addition & 4 deletions io.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,12 @@
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $Id$
*/

#include "defs.h"

#include <fcntl.h>
#if HAVE_SYS_UIO_H
#include <sys/uio.h>
# include <sys/uio.h>
#endif

int
Expand Down
3 changes: 0 additions & 3 deletions ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,9 @@
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $Id$
*/

#include "defs.h"

#include <asm/ioctl.h>

static int
Expand Down
9 changes: 2 additions & 7 deletions ioctlsort.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,11 @@
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $Id$
*/

#include <stdio.h>

#ifdef STDC_HEADERS
#include <stdlib.h>
# include <stdlib.h>
#endif

struct ioctlent {
Expand All @@ -45,9 +42,7 @@ struct ioctlent {
int nioctlents = sizeof ioctlent / sizeof ioctlent[0];

int
compare(a, b)
const void *a;
const void *b;
compare(const void *a, const void *b)
{
unsigned long code1 = ((struct ioctlent *) a)->code;
unsigned long code2 = ((struct ioctlent *) b)->code;
Expand Down
10 changes: 3 additions & 7 deletions ipc.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,12 @@
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $Id$
*/

#include "defs.h"

# ifdef HAVE_MQUEUE_H
# include <mqueue.h>
# endif

#ifdef HAVE_MQUEUE_H
# include <mqueue.h>
#endif
#include <fcntl.h>
#include <sys/ipc.h>
#include <sys/sem.h>
Expand Down
2 changes: 0 additions & 2 deletions linux/alpha/syscallent.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $Id$
*/

{ 6, 0, printargs, "osf_syscall" }, /* 0, not implemented */
Expand Down
2 changes: 0 additions & 2 deletions linux/arm/syscallent.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $Id$
*/

{ 0, 0, sys_restart_syscall, "restart_syscall"}, /* 0 */
Expand Down
2 changes: 0 additions & 2 deletions linux/avr32/syscallent.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $Id$
*/

{ 0, 0, sys_setup, "setup" }, /* 0 */
Expand Down
2 changes: 0 additions & 2 deletions linux/bfin/syscallent.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $Id$
*/

{ 0, 0, sys_restart_syscall, "restart_syscall" }, /* 0 */
Expand Down
2 changes: 0 additions & 2 deletions linux/dummy.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $Id$
*/

/* still unfinished */
Expand Down
3 changes: 0 additions & 3 deletions linux/hppa/syscallent.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
/*
* Copyright (c) 2001 Hewlett-Packard, Matthew Wilcox
*
* $Id$
*
*/

{ 0, 0, sys_restart_syscall, "restart_syscall" }, /* 0 */
Expand Down
2 changes: 0 additions & 2 deletions linux/i386/syscallent.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $Id$
*/

{ 0, 0, sys_restart_syscall, "restart_syscall" }, /* 0 */
Expand Down
2 changes: 0 additions & 2 deletions linux/ia64/syscallent.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $Id$
*/

/*
Expand Down
4 changes: 0 additions & 4 deletions linux/ioctlent.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#! /bin/sh
#
# Copyright (c) 2001 Wichert Akkerman <[email protected]>
# All rights reserved.
#
Expand All @@ -24,9 +23,6 @@
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# $Id$
#

# Validate arg count.
case $# in
Expand Down
2 changes: 0 additions & 2 deletions linux/m68k/syscallent.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $Id$
*/

{ 0, 0, sys_restart_syscall, "restart_syscall" }, /* 0 */
Expand Down
Loading

0 comments on commit a6d91de

Please sign in to comment.