<!DOCTYPE html><html dir="ltr"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><head><body><div><div><br><br><blockquote>---- Original Message ----<br>
From: "Andrew Vagin" &lt;avagin@parallels.com&gt;<br>
To: "Shawn Landden" &lt;shawn@churchofgit.com&gt;<br>CC: criu@openvz.org<br>
Sent: Tue, Dec 24, 2013, 01:41 AM<br>
Subject: Re: [CRIU] [PATCH] use #pragma once instead of #define guards<br><br><br>Why do we need this?</blockquote><blockquote></blockquote><span>It makes the code cleaner. both systemd and kmod have done this. (inspired by my patch to systemd) </span><br><blockquote><br>On Fri, Dec 20, 2013 at 07:20:46PM -0800, Shawn Landden wrote:<br><blockquote>---<br>include/bug.h              | 5 +----<br>include/compiler.h         | 5 +----<br>include/cpu.h              | 5 +----<br>include/cr-service.h       | 5 +----<br>include/cr-show.h          | 5 +----<br>include/cr_options.h       | 5 +----<br>include/crtools.h          | 5 +----<br>include/err.h              | 5 +----<br>include/errno.h            | 5 +----<br>include/eventfd.h          | 5 +----<br>include/eventpoll.h        | 5 +----<br>include/fcntl.h            | 5 +----<br>include/fdset.h            | 5 +----<br>include/fifo.h             | 5 +----<br>include/file-ids.h         | 5 +----<br>include/file-lock.h        | 5 +----<br>include/files-reg.h        | 5 +----<br>include/files.h            | 5 +----<br>include/fsnotify.h         | 5 +----<br>include/image-desc.h       | 5 +----<br>include/image.h            | 5 +----<br>include/inet_diag.h        | 5 +----<br>include/ipc_ns.h           | 5 +----<br>include/kcmp-ids.h         | 5 +----<br>include/kcmp.h             | 5 +----<br>include/kerndat.h          | 5 +----<br>include/libnetlink.h       | 6 +-----<br>include/list.h             | 5 +----<br>include/lock.h             | 5 +----<br>include/log-levels.h       | 5 +----<br>include/log.h              | 5 +----<br>include/magic.h            | 5 +----<br>include/mem.h              | 5 +----<br>include/mman.h             | 5 +----<br>include/mount.h            | 5 +----<br>include/namespaces.h       | 5 +----<br>include/net.h              | 5 +----<br>include/netfilter.h        | 5 +----<br>include/netlink_diag.h     | 5 +----<br>include/packet_diag.h      | 5 +----<br>include/page-pipe.h        | 5 +----<br>include/page-read.h        | 5 +----<br>include/page-xfer.h        | 5 +----<br>include/parasite-syscall.h | 5 +----<br>include/parasite.h         | 5 +----<br>include/pid.h              | 5 +----<br>include/pipes.h            | 5 +----<br>include/posix-timer.h      | 5 +----<br>include/prctl.h            | 5 +----<br>include/proc_parse.h       | 5 +----<br>include/protobuf-desc.h    | 5 +----<br>include/protobuf.h         | 5 +----<br>include/pstree.h           | 5 +----<br>include/ptrace.h           | 5 +----<br>include/rbtree.h           | 5 +----<br>include/restorer.h         | 5 +----<br>include/rst-malloc.h       | 5 +----<br>include/servicefd.h        | 5 +----<br>include/shmem.h            | 5 +----<br>include/signalfd.h         | 5 +----<br>include/sk-inet.h          | 5 +----<br>include/sk-packet.h        | 5 +----<br>include/sk-queue.h         | 5 +----<br>include/sockets.h          | 5 +----<br>include/stats.h            | 5 +----<br>include/string.h           | 5 +----<br>include/syscall-types.h    | 5 +----<br>include/sysctl.h           | 5 +----<br>include/tty.h              | 5 +----<br>include/tun.h              | 5 +----<br>include/unix_diag.h        | 5 +----<br>include/util-pie.h         | 5 +----<br>include/util.h             | 5 +----<br>include/uts_ns.h           | 5 +----<br>include/vdso.h             | 5 +----<br>include/vma.h              | 5 +----<br>include/xmalloc.h          | 5 +----<br>77 files changed, 77 insertions(+), 309 deletions(-)<br><br>diff --git a/include/bug.h b/include/bug.h<br>index 8330fed..4565e70 100644<br>--- a/include/bug.h<br>+++ b/include/bug.h<br>@@ -1,5 +1,4 @@<br>-#ifndef __CR_BUG_H__<br>-#define __CR_BUG_H__<br>+#pragma once<br><br>#include &lt;signal.h&gt;<br><br>@@ -34,5 +33,3 @@<br><br>#define BUG_ON(condition)   BUG_ON_HANDLER((condition))<br>#define BUG()         BUG_ON(true)<br>-<br>-#endif /* __CR_BUG_H__ */<br>diff --git a/include/compiler.h b/include/compiler.h<br>index 3f3e6d6..5a837fc 100644<br>--- a/include/compiler.h<br>+++ b/include/compiler.h<br>@@ -1,5 +1,4 @@<br>-#ifndef __CR_COMPILER_H__<br>-#define __CR_COMPILER_H__<br>+#pragma once<br><br>/*<br>* Various definitions for success build,<br>@@ -67,5 +66,3 @@<br>   _max1 &gt; _max2 ? _max1 : _max2; })<br><br>#define is_log2(v)      (((v) &amp; ((v) - 1)) == 0)<br>-<br>-#endif /* __CR_COMPILER_H__ */<br>diff --git a/include/cpu.h b/include/cpu.h<br>index 08220cf..eb54ce4 100644<br>--- a/include/cpu.h<br>+++ b/include/cpu.h<br>@@ -1,10 +1,7 @@<br>-#ifndef __CR_CPU_H__<br>-#define __CR_CPU_H__<br>+#pragma once<br><br>#include "asm/cpu.h"<br><br>extern void cpu_set_feature(unsigned int feature);<br>extern bool cpu_has_feature(unsigned int feature);<br>extern int cpu_init(void);<br>-<br>-#endif /* __CR_CPU_H__ */<br>diff --git a/include/cr-service.h b/include/cr-service.h<br>index 5c38ac3..4a3791a 100644<br>--- a/include/cr-service.h<br>+++ b/include/cr-service.h<br>@@ -1,5 +1,4 @@<br>-#ifndef __CR_SERVICE_H__<br>-#define __CR_SERVICE_H__<br>+#pragma once<br><br>#include "protobuf/rpc.pb-c.h"<br><br>@@ -12,5 +11,3 @@ extern int send_criu_dump_resp(int socket_fd, bool success, bool restored);<br><br>extern struct _cr_service_client *cr_service_client;<br>extern unsigned int service_sk_ino;<br>-<br>-#endif /* __CR_SERVICE_H__ */<br>diff --git a/include/cr-show.h b/include/cr-show.h<br>index 165f87a..e206d3b 100644<br>--- a/include/cr-show.h<br>+++ b/include/cr-show.h<br>@@ -1,5 +1,4 @@<br>-#ifndef __CR_SHOW_H__<br>-#define __CR_SHOW_H__<br>+#pragma once<br><br>#include &lt;stdbool.h&gt;<br>#include "asm/types.h"<br>@@ -19,5 +18,3 @@ extern void ipc_msg_handler(int fd, void *obj);<br>extern void ipc_sem_handler(int fd, void *obj);<br>extern int cr_parse_fd(int fd, u32 magic);<br>extern void show_tcp_stream(int fd, void *obj);<br>-<br>-#endif /* __CR_SHOW_H__ */<br>diff --git a/include/cr_options.h b/include/cr_options.h<br>index b90b4e1..4db07b1 100644<br>--- a/include/cr_options.h<br>+++ b/include/cr_options.h<br>@@ -1,5 +1,4 @@<br>-#ifndef __CR_OPTIONS_H__<br>-#define __CR_OPTIONS_H__<br>+#pragma once<br><br>#include &lt;stdbool.h&gt;<br><br>@@ -39,5 +38,3 @@ struct cr_options {<br>extern struct cr_options opts;<br><br>extern void init_opts(void);<br>-<br>-#endif /* __CR_OPTIONS_H__ */<br>diff --git a/include/crtools.h b/include/crtools.h<br>index 7c08fd6..ec89d84 100644<br>--- a/include/crtools.h<br>+++ b/include/crtools.h<br>@@ -1,5 +1,4 @@<br>-#ifndef __CR_CRTOOLS_H__<br>-#define __CR_CRTOOLS_H__<br>+#pragma once<br><br>#include &lt;sys/types.h&gt;<br><br>@@ -28,5 +27,3 @@ struct proc_status_creds;<br>extern bool may_dump(struct proc_status_creds *);<br>struct _CredsEntry;<br>extern bool may_restore(struct _CredsEntry *);<br>-<br>-#endif /* __CR_CRTOOLS_H__ */<br>diff --git a/include/err.h b/include/err.h<br>index c5b6165..38f3965 100644<br>--- a/include/err.h<br>+++ b/include/err.h<br>@@ -1,8 +1,7 @@<br>/*<br>* Adopted from linux kernel<br>*/<br>-#ifndef __CR_ERR_H__<br>-#define __CR_ERR_H__<br>+#pragma once<br><br>#include "compiler.h"<br><br>@@ -49,5 +48,3 @@ static inline int PTR_RET(const void *ptr)<br>   else<br>      return 0;<br>}<br>-<br>-#endif /* __CR_ERR_H__ */<br>diff --git a/include/errno.h b/include/errno.h<br>index 5c2322e..f8ff9d3 100644<br>--- a/include/errno.h<br>+++ b/include/errno.h<br>@@ -1,9 +1,6 @@<br>-#ifndef __CR_ERRNO_H__<br>-#define __CR_ERRNO_H__<br>+#pragma once<br><br>#define ERESTARTSYS      512<br>#define ERESTARTNOINTR      513<br>#define ERESTARTNOHAND      514<br>#define ERESTART_RESTARTBLOCK   516<br>-<br>-#endif /* __CR_ERRNO_H__ */<br>diff --git a/include/eventfd.h b/include/eventfd.h<br>index 22a62a0..b66d677 100644<br>--- a/include/eventfd.h<br>+++ b/include/eventfd.h<br>@@ -1,10 +1,7 @@<br>-#ifndef __CR_EVENTFD_H__<br>-#define __CR_EVENTFD_H__<br>+#pragma once<br><br>#include "files.h"<br><br>extern int is_eventfd_link(int lfd);<br>extern const struct fdtype_ops eventfd_dump_ops;<br>extern struct collect_image_info eventfd_cinfo;<br>-<br>-#endif /* __CR_EVENTFD_H__ */<br>diff --git a/include/eventpoll.h b/include/eventpoll.h<br>index 4e6c112..5f4ba88 100644<br>--- a/include/eventpoll.h<br>+++ b/include/eventpoll.h<br>@@ -1,5 +1,4 @@<br>-#ifndef __CR_EVENTPOLL_H__<br>-#define __CR_EVENTPOLL_H__<br>+#pragma once<br><br>#include "files.h"<br><br>@@ -7,5 +6,3 @@ extern int is_eventpoll_link(int lfd);<br>extern const struct fdtype_ops eventpoll_dump_ops;<br>extern struct collect_image_info epoll_tfd_cinfo;<br>extern struct collect_image_info epoll_cinfo;<br>-<br>-#endif /* __CR_EVENTPOLL_H__ */<br>diff --git a/include/fcntl.h b/include/fcntl.h<br>index 65ba2bf..f53c387 100644<br>--- a/include/fcntl.h<br>+++ b/include/fcntl.h<br>@@ -1,5 +1,4 @@<br>-#ifndef __CR_ASM_GENERIC_FCNTL_H__<br>-#define __CR_ASM_GENERIC_FCNTL_H__<br>+#pragma once<br><br>#include &lt;sys/types.h&gt;<br>#include &lt;fcntl.h&gt;<br>@@ -28,5 +27,3 @@ struct f_owner_ex {<br>#ifndef F_GETPIPE_SZ<br># define F_GETPIPE_SZ   (F_LINUX_SPECIFIC_BASE + 8)<br>#endif<br>-<br>-#endif /* __CR_ASM_GENERIC_FCNTL_H__ */<br>diff --git a/include/fdset.h b/include/fdset.h<br>index ad62d5e..b5a0ce2 100644<br>--- a/include/fdset.h<br>+++ b/include/fdset.h<br>@@ -1,5 +1,4 @@<br>-#ifndef __CR_FDSET_H__<br>-#define __CR_FDSET_H__<br>+#pragma once<br><br>#include "image-desc.h"<br>#include "bug.h"<br>@@ -32,5 +31,3 @@ extern struct cr_fdset *cr_fdset_open_range(int pid, int from, int to,<br>extern struct cr_fdset *cr_glob_fdset_open(int mode);<br><br>extern void close_cr_fdset(struct cr_fdset **cr_fdset);<br>-<br>-#endif /* __CR_FDSET_H__ */<br>diff --git a/include/fifo.h b/include/fifo.h<br>index 1824346..edeb308 100644<br>--- a/include/fifo.h<br>+++ b/include/fifo.h<br>@@ -1,5 +1,4 @@<br>-#ifndef __CR_FIFO_H__<br>-#define __CR_FIFO_H__<br>+#pragma once<br><br>struct fd_parms;<br>struct cr_fdset;<br>@@ -7,5 +6,3 @@ struct cr_fdset;<br>extern const struct fdtype_ops fifo_dump_ops;<br>extern struct collect_image_info fifo_cinfo;<br>extern int collect_fifo(void);<br>-<br>-#endif /* __CR_FIFO_H__ */<br>diff --git a/include/file-ids.h b/include/file-ids.h<br>index ce9029d..2d901a7 100644<br>--- a/include/file-ids.h<br>+++ b/include/file-ids.h<br>@@ -1,5 +1,4 @@<br>-#ifndef __CR_FILE_IDS_H__<br>-#define __CR_FILE_IDS_H__<br>+#pragma once<br><br>#include "compiler.h"<br>#include "asm/types.h"<br>@@ -14,5 +13,3 @@ struct fdinfo_entry;<br>extern int fd_id_generate(pid_t pid, FdinfoEntry *fe);<br>extern u32 fd_id_generate_special(void);<br>extern void fd_id_show_tree(void);<br>-<br>-#endif /* __CR_FILE_IDS_H__ */<br>diff --git a/include/file-lock.h b/include/file-lock.h<br>index 56de975..a0ba993 100644<br>--- a/include/file-lock.h<br>+++ b/include/file-lock.h<br>@@ -1,5 +1,4 @@<br>-#ifndef __FILE_LOCK_H__<br>-#define __FILE_LOCK_H__<br>+#pragma once<br><br>#include "list.h"<br><br>@@ -55,5 +54,3 @@ extern int dump_task_file_locks(struct parasite_ctl *ctl,<br>extern int prepare_file_locks(int pid);<br><br>#define OPT_FILE_LOCKS   "file-locks"<br>-<br>-#endif /* __FILE_LOCK_H__ */<br>diff --git a/include/files-reg.h b/include/files-reg.h<br>index d3bd4f0..711d734 100644<br>--- a/include/files-reg.h<br>+++ b/include/files-reg.h<br>@@ -1,5 +1,4 @@<br>-#ifndef __CR_FILES_REG_H__<br>-#define __CR_FILES_REG_H__<br>+#pragma once<br><br>#include "asm/types.h"<br>#include "files.h"<br>@@ -40,5 +39,3 @@ extern struct collect_image_info remap_cinfo;<br><br>extern void delete_link_remaps(void);<br>extern void free_link_remaps(void);<br>-<br>-#endif /* __CR_FILES_REG_H__ */<br>diff --git a/include/files.h b/include/files.h<br>index d491cf1..51615c4 100644<br>--- a/include/files.h<br>+++ b/include/files.h<br>@@ -1,5 +1,4 @@<br>-#ifndef __CR_FILES_H__<br>-#define __CR_FILES_H__<br>+#pragma once<br><br>#include "compiler.h"<br>#include "asm/types.h"<br>@@ -146,5 +145,3 @@ extern int close_old_fds(struct pstree_item *me);<br>#define LREMAP_PARAM   "link-remap"<br><br>extern int shared_fdt_prepare(struct pstree_item *item);<br>-<br>-#endif /* __CR_FILES_H__ */<br>diff --git a/include/fsnotify.h b/include/fsnotify.h<br>index a882fd9..fbd4667 100644<br>--- a/include/fsnotify.h<br>+++ b/include/fsnotify.h<br>@@ -1,5 +1,4 @@<br>-#ifndef __CR_FSNOTIFY_H__<br>-#define __CR_FSNOTIFY_H__<br>+#pragma once<br><br>#include "asm/types.h"<br>#include "files.h"<br>@@ -18,5 +17,3 @@ extern struct collect_image_info inotify_cinfo;<br>extern struct collect_image_info inotify_mark_cinfo;<br>extern struct collect_image_info fanotify_cinfo;<br>extern struct collect_image_info fanotify_mark_cinfo;<br>-<br>-#endif /* __CR_FSNOTIFY_H__ */<br>diff --git a/include/image-desc.h b/include/image-desc.h<br>index a38368b..fce0247 100644<br>--- a/include/image-desc.h<br>+++ b/include/image-desc.h<br>@@ -1,5 +1,4 @@<br>-#ifndef __CR_IMAGE_DESC_H__<br>-#define __CR_IMAGE_DESC_H__<br>+#pragma once<br><br>#include "asm/int.h"<br><br>@@ -96,5 +95,3 @@ struct cr_fd_desc_tmpl {<br>};<br><br>extern struct cr_fd_desc_tmpl fdset_template[CR_FD_MAX];<br>-<br>-#endif /* __CR_IMAGE_DESC_H__ */<br>diff --git a/include/image.h b/include/image.h<br>index 099f510..052661a 100644<br>--- a/include/image.h<br>+++ b/include/image.h<br>@@ -1,5 +1,4 @@<br>-#ifndef __CR_IMAGE_H__<br>-#define __CR_IMAGE_H__<br>+#pragma once<br><br>#include &lt;stdbool.h&gt;<br><br>@@ -76,5 +75,3 @@ extern int open_image_at(int dfd, int type, unsigned long flags, ...);<br>extern int open_pages_image(unsigned long flags, int pm_fd);<br>extern int open_pages_image_at(int dfd, unsigned long flags, int pm_fd);<br>extern void up_page_ids_base(void);<br>-<br>-#endif /* __CR_IMAGE_H__ */<br>diff --git a/include/inet_diag.h b/include/inet_diag.h<br>index 95be2c1..d22b0b1 100644<br>--- a/include/inet_diag.h<br>+++ b/include/inet_diag.h<br>@@ -1,5 +1,4 @@<br>-#ifndef __CR_INET_DIAG_H__<br>-#define __CR_INET_DIAG_H__<br>+#pragma once<br><br>#include &lt;linux/types.h&gt;<br><br>@@ -132,5 +131,3 @@ struct tcpvegas_info {<br>   __u32   tcpv_rtt;<br>   __u32   tcpv_minrtt;<br>};<br>-<br>-#endif /* __CR_INET_DIAG_H__ */<br>diff --git a/include/ipc_ns.h b/include/ipc_ns.h<br>index a50281f..84c2eab 100644<br>--- a/include/ipc_ns.h<br>+++ b/include/ipc_ns.h<br>@@ -1,9 +1,6 @@<br>-#ifndef __CR_IPC_NS_H__<br>-#define __CR_IPC_NS_H__<br>+#pragma once<br><br>extern int dump_ipc_ns(int ns_pid, int ns_id);<br>extern int prepare_ipc_ns(int pid);<br><br>extern struct ns_desc ipc_ns_desc;<br>-<br>-#endif /* __CR_IPC_NS_H__ */<br>diff --git a/include/kcmp-ids.h b/include/kcmp-ids.h<br>index e9e9101..c26d986 100644<br>--- a/include/kcmp-ids.h<br>+++ b/include/kcmp-ids.h<br>@@ -1,5 +1,4 @@<br>-#ifndef __CR_KCMP_IDS_H__<br>-#define __CR_KCMP_IDS_H__<br>+#pragma once<br><br>#include "kcmp.h"<br><br>@@ -26,5 +25,3 @@ struct kid_elem {<br>extern u32 kid_generate_gen(struct kid_tree *tree,<br>             struct kid_elem *elem, int *new_id);<br>extern void kid_show_tree(struct kid_tree *tree);<br>-<br>-#endif /* __CR_KCMP_IDS_H__ */<br>diff --git a/include/kcmp.h b/include/kcmp.h<br>index 76f557b..f275619 100644<br>--- a/include/kcmp.h<br>+++ b/include/kcmp.h<br>@@ -1,5 +1,4 @@<br>-#ifndef __CR_KCMP_H__<br>-#define __CR_KCMP_H__<br>+#pragma once<br><br>enum kcmp_type {<br>   KCMP_FILE,<br>@@ -12,5 +11,3 @@ enum kcmp_type {<br><br>   KCMP_TYPES,<br>};<br>-<br>-#endif /* __CR_KCMP_H__ */<br>diff --git a/include/kerndat.h b/include/kerndat.h<br>index 738ad04..64f9f0b 100644<br>--- a/include/kerndat.h<br>+++ b/include/kerndat.h<br>@@ -1,5 +1,4 @@<br>-#ifndef __CR_KERNDAT_H__<br>-#define __CR_KERNDAT_H__<br>+#pragma once<br><br>#include "asm/types.h"<br><br>@@ -19,5 +18,3 @@ extern int tcp_max_wshare;<br>extern int tcp_max_rshare;<br><br>extern int kern_last_cap;<br>-<br>-#endif /* __CR_KERNDAT_H__ */<br>diff --git a/include/libnetlink.h b/include/libnetlink.h<br>index 616a111..03679e9 100644<br>--- a/include/libnetlink.h<br>+++ b/include/libnetlink.h<br>@@ -1,5 +1,4 @@<br>-#ifndef __CR_LIBNETLINK_H__<br>-#define __CR_LIBNETLINK_H__<br>+#pragma once<br><br>#define CR_NLMSG_SEQ      24680   /* arbitrary chosen */<br><br>@@ -14,6 +13,3 @@ extern int addattr_l(struct nlmsghdr *n, int maxlen, int type,<br><br>#define NLMSG_TAIL(nmsg) \<br>   ((struct rtattr *) (((void *) (nmsg)) + NLMSG_ALIGN((nmsg)-&gt;nlmsg_len)))<br>-<br>-<br>-#endif /* __CR_LIBNETLINK_H__ */<br>diff --git a/include/list.h b/include/list.h<br>index 32d8edd..28508c4 100644<br>--- a/include/list.h<br>+++ b/include/list.h<br>@@ -1,5 +1,4 @@<br>-#ifndef __CR_LIST_H__<br>-#define __CR_LIST_H__<br>+#pragma once<br><br>/*<br>* Double linked lists.<br>@@ -419,5 +418,3 @@ static inline void hlist_move_list(struct hlist_head *old,<br>   for (pos = hlist_entry_safe((head)-&gt;first, typeof(*pos), member);   \<br>        pos &amp;&amp; ({ n = pos-&gt;member.next; 1; });            \<br>        pos = hlist_entry_safe(n, typeof(*pos), member))<br>-<br>-#endif /* __CR_LIST_H__ */<br>diff --git a/include/lock.h b/include/lock.h<br>index 89d71b1..adde3da 100644<br>--- a/include/lock.h<br>+++ b/include/lock.h<br>@@ -1,5 +1,4 @@<br>-#ifndef __CR_LOCK_H__<br>-#define __CR_LOCK_H__<br>+#pragma once<br><br>#include &lt;linux/futex.h&gt;<br>#include &lt;sys/time.h&gt;<br>@@ -135,5 +134,3 @@ static inline void mutex_unlock(mutex_t *m)<br>   atomic_set(&amp;m-&gt;raw, (int)c);<br>   BUG_ON(sys_futex((u32 *)&amp;m-&gt;raw.counter, FUTEX_WAKE, 1, NULL, NULL, 0) &lt; 0);<br>}<br>-<br>-#endif /* __CR_LOCK_H__ */<br>diff --git a/include/log-levels.h b/include/log-levels.h<br>index 3e6753f..6a1aa2f 100644<br>--- a/include/log-levels.h<br>+++ b/include/log-levels.h<br>@@ -1,5 +1,4 @@<br>-#ifndef __CR_LOG_LEVELS_H__<br>-#define __CR_LOG_LEVELS_H__<br>+#pragma once<br><br>#define LOG_MSG      (0) /* Print message regardless of log level */<br>#define LOG_ERROR   (1) /* Errors only, when we're in trouble */<br>@@ -8,5 +7,3 @@<br>#define LOG_DEBUG   (4) /* Debug only */<br><br>#define DEFAULT_LOGLEVEL   LOG_WARN<br>-<br>-#endif /* __CR_LOG_LEVELS_H__ */<br>diff --git a/include/log.h b/include/log.h<br>index 1060254..ebd035f 100644<br>--- a/include/log.h<br>+++ b/include/log.h<br>@@ -1,5 +1,4 @@<br>-#ifndef __CR_LOG_H__<br>-#define __CR_LOG_H__<br>+#pragma once<br><br>#include "log-levels.h"<br><br>@@ -63,5 +62,3 @@ extern int write_pidfile(int pid);<br><br>extern void print_data(unsigned long addr, unsigned char *data, size_t size);<br>extern void print_image_data(int fd, unsigned int length, int show);<br>-<br>-#endif /* __CR_LOG_H__ */<br>diff --git a/include/magic.h b/include/magic.h<br>index f17a191..cfdf8c8 100644<br>--- a/include/magic.h<br>+++ b/include/magic.h<br>@@ -1,5 +1,4 @@<br>-#ifndef __CR_MAGIC_H__<br>-#define __CR_MAGIC_H__<br>+#pragma once<br><br>/*<br>* Basic multi-file images<br>@@ -79,5 +78,3 @@<br><br>#define PAGES_OLD_MAGIC      PAGEMAP_MAGIC<br>#define SHM_PAGES_OLD_MAGIC   PAGEMAP_MAGIC<br>-<br>-#endif /* __CR_MAGIC_H__ */<br>diff --git a/include/mem.h b/include/mem.h<br>index 6cfd2e3..f596632 100644<br>--- a/include/mem.h<br>+++ b/include/mem.h<br>@@ -1,5 +1,4 @@<br>-#ifndef __CR_MEM_H__<br>-#define __CR_MEM_H__<br>+#pragma once<br><br>struct parasite_ctl;<br>struct vm_area_list;<br>@@ -21,5 +20,3 @@ extern int parasite_dump_pages_seized(struct parasite_ctl *ctl,<br>#define PME_PSHIFT_OFFSET   (PME_STATUS_OFFSET - PME_PSHIFT_BITS)<br>#define PME_PFRAME_MASK      ((1ULL &lt;&lt; PME_PSHIFT_OFFSET) - 1)<br>#define PME_PFRAME(x)      ((x) &amp; PME_PFRAME_MASK)<br>-<br>-#endif /* __CR_MEM_H__ */<br>diff --git a/include/mman.h b/include/mman.h<br>index 340d369..1b00088 100644<br>--- a/include/mman.h<br>+++ b/include/mman.h<br>@@ -1,5 +1,4 @@<br>-#ifndef __CR_MMAN_H__<br>-#define __CR_MMAN_H__<br>+#pragma once<br><br>#ifndef MAP_HUGETLB<br># define MAP_HUGETLB      0x40000<br>@@ -13,5 +12,3 @@<br>#ifndef MADV_DONTDUMP<br># define MADV_DONTDUMP      16<br>#endif<br>-<br>-#endif /* __CR_MMAN_H__ */<br>diff --git a/include/mount.h b/include/mount.h<br>index a76c027..c0c3cd3 100644<br>--- a/include/mount.h<br>+++ b/include/mount.h<br>@@ -1,5 +1,4 @@<br>-#ifndef __CR_MOUNT_H__<br>-#define __CR_MOUNT_H__<br>+#pragma once<br><br>extern int mntns_root;<br>extern int mntns_collect_root(pid_t pid);<br>@@ -24,5 +23,3 @@ extern struct ns_desc mnt_ns_desc;<br><br>extern dev_t phys_stat_resolve_dev(dev_t st_dev, const char *path);<br>extern bool phys_stat_dev_match(dev_t st_dev, dev_t phys_dev, const char *path);<br>-<br>-#endif /* __CR_MOUNT_H__ */<br>diff --git a/include/namespaces.h b/include/namespaces.h<br>index 163de8e..f41ff0d 100644<br>--- a/include/namespaces.h<br>+++ b/include/namespaces.h<br>@@ -1,5 +1,4 @@<br>-#ifndef __CR_NS_H__<br>-#define __CR_NS_H__<br>+#pragma once<br><br>#include "files.h"<br><br>@@ -33,5 +32,3 @@ extern int switch_ns(int pid, struct ns_desc *nd, int *rst);<br>extern int restore_ns(int rst, struct ns_desc *nd);<br><br>extern int dump_task_ns_ids(struct pstree_item *);<br>-<br>-#endif /* __CR_NS_H__ */<br>diff --git a/include/net.h b/include/net.h<br>index eb29cf5..949b475 100644<br>--- a/include/net.h<br>+++ b/include/net.h<br>@@ -1,5 +1,4 @@<br>-#ifndef __CR_NET_H__<br>-#define __CR_NET_H__<br>+#pragma once<br><br>#include "list.h"<br><br>@@ -23,5 +22,3 @@ extern struct ns_desc net_ns_desc;<br>extern int write_netdev_img(NetDeviceEntry *nde, struct cr_fdset *fds);<br>extern int read_ns_sys_file(char *path, char *buf, int len);<br>extern int restore_link_parms(NetDeviceEntry *nde, int nlsk);<br>-<br>-#endif /* __CR_NET_H__ */<br>diff --git a/include/netfilter.h b/include/netfilter.h<br>index f3667fc..1ec43c7 100644<br>--- a/include/netfilter.h<br>+++ b/include/netfilter.h<br>@@ -1,5 +1,4 @@<br>-#ifndef __CR_NETFILTER_H__<br>-#define __CR_NETFILTER_H__<br>+#pragma once<br><br>struct inet_sk_desc;<br>extern int nf_lock_connection(struct inet_sk_desc *);<br>@@ -7,5 +6,3 @@ extern int nf_unlock_connection(struct inet_sk_desc *);<br><br>struct inet_sk_info;<br>extern int nf_unlock_connection_info(struct inet_sk_info *);<br>-<br>-#endif /* __CR_NETFILTER_H__ */<br>diff --git a/include/netlink_diag.h b/include/netlink_diag.h<br>index 14ca403..c080a8f 100644<br>--- a/include/netlink_diag.h<br>+++ b/include/netlink_diag.h<br>@@ -1,5 +1,4 @@<br>-#ifndef __CR_NETLINK_DIAG_H__<br>-#define __CR_NETLINK_DIAG_H__<br>+#pragma once<br><br>#include &lt;linux/types.h&gt;<br><br>@@ -38,5 +37,3 @@ enum {<br><br>#define NDIAG_SHOW_MEMINFO   0x00000001 /* show memory info of a socket */<br>#define NDIAG_SHOW_GROUPS   0x00000002 /* show groups of a netlink socket */<br>-<br>-#endif /* __CR_NETLINK_DIAG_H__ */<br>diff --git a/include/packet_diag.h b/include/packet_diag.h<br>index e5d9193..62a4e52 100644<br>--- a/include/packet_diag.h<br>+++ b/include/packet_diag.h<br>@@ -1,5 +1,4 @@<br>-#ifndef __CR_PACKET_DIAG_H__<br>-#define __CR_PACKET_DIAG_H__<br>+#pragma once<br><br>#include &lt;linux/types.h&gt;<br><br>@@ -72,5 +71,3 @@ struct packet_diag_ring {<br>   __u32   pdr_sizeof_priv;<br>   __u32   pdr_features;<br>};<br>-<br>-#endif /* __CR_PACKET_DIAG_H__ */<br>diff --git a/include/page-pipe.h b/include/page-pipe.h<br>index 393627b..a5f8858 100644<br>--- a/include/page-pipe.h<br>+++ b/include/page-pipe.h<br>@@ -1,5 +1,4 @@<br>-#ifndef __CR_PAGE_PIPE_H__<br>-#define __CR_PAGE_PIPE_H__<br>+#pragma once<br><br>#include &lt;sys/uio.h&gt;<br>#include "list.h"<br>@@ -97,5 +96,3 @@ extern int page_pipe_add_page(struct page_pipe *p, unsigned long addr);<br>extern int page_pipe_add_hole(struct page_pipe *p, unsigned long addr);<br><br>extern void debug_show_page_pipe(struct page_pipe *pp);<br>-<br>-#endif /* __CR_PAGE_PIPE_H__ */<br>diff --git a/include/page-read.h b/include/page-read.h<br>index 5a11348..beadc53 100644<br>--- a/include/page-read.h<br>+++ b/include/page-read.h<br>@@ -1,5 +1,4 @@<br>-#ifndef __CR_PAGE_READ_H__<br>-#define __CR_PAGE_READ_H__<br>+#pragma once<br><br>#include "protobuf/pagemap.pb-c.h"<br><br>@@ -67,5 +66,3 @@ struct page_read {<br>};<br><br>extern int open_page_read(int pid, struct page_read *);<br>-<br>-#endif /* __CR_PAGE_READ_H__ */<br>diff --git a/include/page-xfer.h b/include/page-xfer.h<br>index a681eb6..654070b 100644<br>--- a/include/page-xfer.h<br>+++ b/include/page-xfer.h<br>@@ -1,5 +1,4 @@<br>-#ifndef __CR_PAGE_XFER__H__<br>-#define __CR_PAGE_XFER__H__<br>+#pragma once<br><br>extern int cr_page_server(bool daemon_mode);<br><br>@@ -32,5 +31,3 @@ extern int page_xfer_dump_pages(struct page_xfer *, struct page_pipe *,<br>            unsigned long off);<br>extern int connect_to_page_server(void);<br>extern int disconnect_from_page_server(void);<br>-<br>-#endif /* __CR_PAGE_XFER__H__ */<br>diff --git a/include/parasite-syscall.h b/include/parasite-syscall.h<br>index 023d002..64474fa 100644<br>--- a/include/parasite-syscall.h<br>+++ b/include/parasite-syscall.h<br>@@ -1,5 +1,4 @@<br>-#ifndef __CR_PARASITE_SYSCALL_H__<br>-#define __CR_PARASITE_SYSCALL_H__<br>+#pragma once<br><br>#include "asm/types.h"<br>#include "pid.h"<br>@@ -122,5 +121,3 @@ extern int parasite_fixup_vdso(struct parasite_ctl *ctl, pid_t pid,<br><br>extern int parasite_stop_on_syscall(int tasks, int sys_nr);<br>extern int parasite_unmap(struct parasite_ctl *ctl, unsigned long addr);<br>-<br>-#endif /* __CR_PARASITE_SYSCALL_H__ */<br>diff --git a/include/parasite.h b/include/parasite.h<br>index d53242e..867402b 100644<br>--- a/include/parasite.h<br>+++ b/include/parasite.h<br>@@ -1,5 +1,4 @@<br>-#ifndef __CR_PARASITE_H__<br>-#define __CR_PARASITE_H__<br>+#pragma once<br><br>#define PARASITE_STACK_SIZE   (16 &lt;&lt; 10)<br>#define PARASITE_ARG_SIZE_MIN   ( 1 &lt;&lt; 12)<br>@@ -201,5 +200,3 @@ struct parasite_tty_args {<br>#define parasite_sym(pblob, name) ((void *)(pblob) + parasite_blob_offset__##name)<br><br>#endif /* !__ASSEMBLY__ */<br>-<br>-#endif /* __CR_PARASITE_H__ */<br>diff --git a/include/pid.h b/include/pid.h<br>index d073944..1f85d8d 100644<br>--- a/include/pid.h<br>+++ b/include/pid.h<br>@@ -1,5 +1,4 @@<br>-#ifndef __CR_PID_H__<br>-#define __CR_PID_H__<br>+#pragma once<br><br>#include "stdbool.h"<br><br>@@ -28,5 +27,3 @@ static inline bool pid_rst_prio(unsigned pid_a, unsigned pid_b)<br>{<br>   return pid_a &lt; pid_b;<br>}<br>-<br>-#endif /* __CR_PID_H__ */<br>diff --git a/include/pipes.h b/include/pipes.h<br>index a52857a..d847cdd 100644<br>--- a/include/pipes.h<br>+++ b/include/pipes.h<br>@@ -1,5 +1,4 @@<br>-#ifndef __CR_PIPES_H__<br>-#define __CR_PIPES_H__<br>+#pragma once<br><br>#include "protobuf/pipe-data.pb-c.h"<br><br>@@ -35,5 +34,3 @@ struct pipe_data_rst {<br><br>extern int collect_pipe_data(int img_type, struct pipe_data_rst **hash);<br>extern int restore_pipe_data(int img_type, int pfd, u32 id, struct pipe_data_rst **hash);<br>-<br>-#endif /* __CR_PIPES_H__ */<br>diff --git a/include/posix-timer.h b/include/posix-timer.h<br>index f5d089c..6060f2d 100644<br>--- a/include/posix-timer.h<br>+++ b/include/posix-timer.h<br>@@ -1,5 +1,4 @@<br>-#ifndef __CR_PROC_POSIX_TIMER_H__<br>-#define __CR_PROC_POSIX_TIMER_H__<br>+#pragma once<br><br>#include "list.h"<br><br>@@ -22,5 +21,3 @@ struct proc_posix_timers_stat {<br>};<br><br>extern int parse_posix_timers(pid_t pid, struct proc_posix_timers_stat * args);<br>-<br>-#endif /* __CR_PROC_POSIX_TIMER_H__ */<br>diff --git a/include/prctl.h b/include/prctl.h<br>index 2bf1a13..3cbe5a3 100644<br>--- a/include/prctl.h<br>+++ b/include/prctl.h<br>@@ -1,5 +1,4 @@<br>-#ifndef __CR_PRCTL_H__<br>-#define __CR_PRCTL_H__<br>+#pragma once<br><br>#ifndef PR_SET_NAME<br># define PR_SET_NAME      15<br>@@ -37,5 +36,3 @@<br>#ifndef PR_GET_TID_ADDRESS<br># define PR_GET_TID_ADDRESS   40<br>#endif<br>-<br>-#endif /* __CR_PRCTL_H__ */<br>diff --git a/include/proc_parse.h b/include/proc_parse.h<br>index 9af46f6..17f0762 100644<br>--- a/include/proc_parse.h<br>+++ b/include/proc_parse.h<br>@@ -1,5 +1,4 @@<br>-#ifndef __CR_PROC_PARSE_H__<br>-#define __CR_PROC_PARSE_H__<br>+#pragma once<br><br>#include &lt;sys/types.h&gt;<br>#include "asm/types.h"<br>@@ -157,5 +156,3 @@ extern int parse_file_locks(void);<br><br>struct pid;<br>extern int parse_threads(int pid, struct pid **_t, int *_n);<br>-<br>-#endif /* __CR_PROC_PARSE_H__ */<br>diff --git a/include/protobuf-desc.h b/include/protobuf-desc.h<br>index fd9ee43..ca797ed 100644<br>--- a/include/protobuf-desc.h<br>+++ b/include/protobuf-desc.h<br>@@ -1,5 +1,4 @@<br>-#ifndef __CR_PROTOBUF_DESC_H__<br>-#define __CR_PROTOBUF_DESC_H__<br>+#pragma once<br><br>#include &lt;sys/types.h&gt;<br>#include &lt;google/protobuf-c/protobuf-c.h&gt;<br>@@ -78,5 +77,3 @@ struct cr_pb_message_desc {<br><br>extern void cr_pb_init(void);<br>extern struct cr_pb_message_desc cr_pb_descs[PB_MAX];<br>-<br>-#endif /* __CR_PROTOBUF_DESC_H__ */<br>diff --git a/include/protobuf.h b/include/protobuf.h<br>index ae9a65c..ebf7788 100644<br>--- a/include/protobuf.h<br>+++ b/include/protobuf.h<br>@@ -1,5 +1,4 @@<br>-#ifndef __CR_PROTOBUF_H__<br>-#define __CR_PROTOBUF_H__<br>+#pragma once<br><br>#include "protobuf-desc.h"<br><br>@@ -51,5 +50,3 @@ struct collect_image_info {<br>#define COLLECT_OPTIONAL   0x2   /* image file may be missing */<br><br>extern int collect_image(struct collect_image_info *);<br>-<br>-#endif /* __CR_PROTOBUF_H__ */<br>diff --git a/include/pstree.h b/include/pstree.h<br>index c1f7426..a8bb7b5 100644<br>--- a/include/pstree.h<br>+++ b/include/pstree.h<br>@@ -1,5 +1,4 @@<br>-#ifndef __CR_PSTREE_H__<br>-#define __CR_PSTREE_H__<br>+#pragma once<br><br>#include "list.h"<br>#include "pid.h"<br>@@ -66,5 +65,3 @@ extern void core_entry_free(CoreEntry *core);<br>extern CoreEntry *core_entry_alloc(int alloc_thread_info, int alloc_tc);<br>extern int pstree_alloc_cores(struct pstree_item *item);<br>extern void pstree_free_cores(struct pstree_item *item);<br>-<br>-#endif /* __CR_PSTREE_H__ */<br>diff --git a/include/ptrace.h b/include/ptrace.h<br>index d8034b4..0cc2d1a 100644<br>--- a/include/ptrace.h<br>+++ b/include/ptrace.h<br>@@ -1,5 +1,4 @@<br>-#ifndef __CR_PTRACE_H__<br>-#define __CR_PTRACE_H__<br>+#pragma once<br><br>#include &lt;linux/types.h&gt;<br>#include &lt;sys/ptrace.h&gt;<br>@@ -60,5 +59,3 @@ extern int unseize_task(pid_t pid, int state);<br>extern int ptrace_peek_area(pid_t pid, void *dst, void *addr, long bytes);<br>extern int ptrace_poke_area(pid_t pid, void *src, void *addr, long bytes);<br>extern int ptrace_swap_area(pid_t pid, void *dst, void *src, long bytes);<br>-<br>-#endif /* __CR_PTRACE_H__ */<br>diff --git a/include/rbtree.h b/include/rbtree.h<br>index f608210..e081333 100644<br>--- a/include/rbtree.h<br>+++ b/include/rbtree.h<br>@@ -2,8 +2,7 @@<br>* RBtree implementation adopted from the Linux kernel sources.<br>*/<br><br>-#ifndef __CR_RBTREE_H__<br>-#define __CR_RBTREE_H__<br>+#pragma once<br><br>#include &lt;stddef.h&gt;<br><br>@@ -85,5 +84,3 @@ static inline void rb_link_and_balance(struct rb_root *root,<br>   rb_link_node(node, parent, rb_link);<br>   rb_insert_color(node, root);<br>}<br>-<br>-#endif /* __CR_RBTREE_H__ */<br>diff --git a/include/restorer.h b/include/restorer.h<br>index e283b28..5026fda 100644<br>--- a/include/restorer.h<br>+++ b/include/restorer.h<br>@@ -1,5 +1,4 @@<br>-#ifndef __CR_RESTORER_H__<br>-#define __CR_RESTORER_H__<br>+#pragma once<br><br>#include &lt;signal.h&gt;<br>#include &lt;limits.h&gt;<br>@@ -188,5 +187,3 @@ enum {<br>#define vma_priv(vma) ((vma_entry_is(vma, VMA_AREA_REGULAR)) &amp;&amp;   \<br>         (vma_entry_is(vma, VMA_ANON_PRIVATE) || \<br>         vma_entry_is(vma, VMA_FILE_PRIVATE)))<br>-<br>-#endif /* __CR_RESTORER_H__ */<br>diff --git a/include/rst-malloc.h b/include/rst-malloc.h<br>index 75d0d3f..362ecad 100644<br>--- a/include/rst-malloc.h<br>+++ b/include/rst-malloc.h<br>@@ -1,5 +1,4 @@<br>-#ifndef __CR_RST_MALLOC__H__<br>-#define __CR_RST_MALLOC__H__<br>+#pragma once<br><br>/*<br>* On restore we need differetn types of memory allocation.<br>@@ -64,5 +63,3 @@ extern void rst_mem_free_last(int type);<br>*/<br>extern unsigned long rst_mem_remap_size(void);<br>extern int rst_mem_remap(void *to);<br>-<br>-#endif /* __CR_RST_MALLOC__H__ */<br>diff --git a/include/servicefd.h b/include/servicefd.h<br>index ea52bea..a4c0220 100644<br>--- a/include/servicefd.h<br>+++ b/include/servicefd.h<br>@@ -1,6 +1,4 @@<br>-#ifndef __CR_SERVICE_FD_H__<br>-#define __CR_SERVICE_FD_H__<br>-<br>+#pragma once<br>#include &lt;stdbool.h&gt;<br><br>enum sfd_type {<br>@@ -29,4 +27,3 @@ extern int close_service_fd(enum sfd_type type);<br>extern bool is_service_fd(int fd, enum sfd_type type);<br>extern bool is_any_service_fd(int fd);<br><br>-#endif /* __CR_SERVICE_FD_H__ */<br>diff --git a/include/shmem.h b/include/shmem.h<br>index cdb0589..df361db 100644<br>--- a/include/shmem.h<br>+++ b/include/shmem.h<br>@@ -1,5 +1,4 @@<br>-#ifndef __CR_SHMEM_H__<br>-#define __CR_SHMEM_H__<br>+#pragma once<br><br>#include "lock.h"<br><br>@@ -44,5 +43,3 @@ find_shmem(struct shmem_info *shmems, int nr, unsigned long shmid)<br><br>   return NULL;<br>}<br>-<br>-#endif /* __CR_SHMEM_H__ */<br>diff --git a/include/signalfd.h b/include/signalfd.h<br>index b36f9ac..40fe345 100644<br>--- a/include/signalfd.h<br>+++ b/include/signalfd.h<br>@@ -1,10 +1,7 @@<br>-#ifndef __CR_SIGNALFD_H__<br>-#define __CR_SIGNALFD_H__<br>+#pragma once<br><br>struct cr_fdset;<br>struct fd_parms;<br>extern int is_signalfd_link(int lfd);<br>extern const struct fdtype_ops signalfd_dump_ops;<br>extern struct collect_image_info signalfd_cinfo;<br>-<br>-#endif /* __CR_SIGNALFD_H__ */<br>diff --git a/include/sk-inet.h b/include/sk-inet.h<br>index e8fc74f..1c5be8b 100644<br>--- a/include/sk-inet.h<br>+++ b/include/sk-inet.h<br>@@ -1,5 +1,4 @@<br>-#ifndef __CR_SK_INET_H__<br>-#define __CR_SK_INET_H__<br>+#pragma once<br><br>#include &lt;netinet/tcp.h&gt;<br><br>@@ -79,5 +78,3 @@ extern int restore_one_tcp(int sk, struct inet_sk_info *si);<br><br>extern int check_tcp(void);<br>extern int rst_tcp_socks_add(int fd, bool reuseaddr);<br>-<br>-#endif /* __CR_SK_INET_H__ */<br>diff --git a/include/sk-packet.h b/include/sk-packet.h<br>index 4c740c0..994a2ee 100644<br>--- a/include/sk-packet.h<br>+++ b/include/sk-packet.h<br>@@ -1,5 +1,4 @@<br>-#ifndef __CR_SK_PACKET_H__<br>-#define __CR_SK_PACKET_H__<br>+#pragma once<br><br>#ifndef PACKET_TIMESTAMP<br>#define PACKET_TIMESTAMP   17<br>@@ -33,5 +32,3 @@ struct tpacket_req3 {<br>   unsigned int tp_feature_req_word;<br>};<br>#endif<br>-<br>-#endif /* __CR_SK_PACKET_H__ */<br>diff --git a/include/sk-queue.h b/include/sk-queue.h<br>index 9044de0..c5fe93f 100644<br>--- a/include/sk-queue.h<br>+++ b/include/sk-queue.h<br>@@ -1,8 +1,5 @@<br>-#ifndef __CR_SK_QUEUE_H__<br>-#define __CR_SK_QUEUE_H__<br>+#pragma once<br><br>extern int read_sk_queues(void);<br>extern int dump_sk_queue(int sock_fd, int sock_id);<br>extern int restore_sk_queue(int fd, unsigned int peer_id);<br>-<br>-#endif /* __CR_SK_QUEUE_H__ */<br>diff --git a/include/sockets.h b/include/sockets.h<br>index 34ae0ac..5a22ce7 100644<br>--- a/include/sockets.h<br>+++ b/include/sockets.h<br>@@ -1,5 +1,4 @@<br>-#ifndef __CR_SOCKETS_H__<br>-#define __CR_SOCKETS_H__<br>+#pragma once<br><br>#include &lt;stdbool.h&gt;<br><br>@@ -79,5 +78,3 @@ static inline int sk_decode_shutdown(int val)<br>}<br><br>#define USK_EXT_PARAM "ext-unix-sk"<br>-<br>-#endif /* __CR_SOCKETS_H__ */<br>diff --git a/include/stats.h b/include/stats.h<br>index aa25050..629c7ae 100644<br>--- a/include/stats.h<br>+++ b/include/stats.h<br>@@ -1,5 +1,4 @@<br>-#ifndef __CR_STATS_H__<br>-#define __CR_STATS_H__<br>+#pragma once<br><br>enum {<br>   TIME_FREEZING,<br>@@ -42,5 +41,3 @@ extern void cnt_add(int c, unsigned long val);<br><br>extern int init_stats(int what);<br>extern void write_stats(int what);<br>-<br>-#endif /* __CR_STATS_H__ */<br>diff --git a/include/string.h b/include/string.h<br>index 8454b4d..9b52cb4 100644<br>--- a/include/string.h<br>+++ b/include/string.h<br>@@ -1,5 +1,4 @@<br>-#ifndef __CR_STRING_H__<br>-#define __CR_STRING_H__<br>+#pragma once<br><br>#include &lt;sys/types.h&gt;<br>#include &lt;string.h&gt;<br>@@ -13,5 +12,3 @@ extern size_t strlcpy(char *dest, const char *src, size_t size);<br>#ifndef CONFIG_HAS_STRLCAT<br>extern size_t strlcat(char *dest, const char *src, size_t count);<br>#endif<br>-<br>-#endif /* __CR_STRING_H__ */<br>diff --git a/include/syscall-types.h b/include/syscall-types.h<br>index ca22b8e..3e451d7 100644<br>--- a/include/syscall-types.h<br>+++ b/include/syscall-types.h<br>@@ -5,8 +5,7 @@<br>* Anything else should go to plain type.h<br>*/<br><br>-#ifndef __CR_SYSCALL_TYPES_H__<br>-#define __CR_SYSCALL_TYPES_H__<br>+#pragma once<br><br>#include &lt;sys/time.h&gt;<br>#include &lt;arpa/inet.h&gt;<br>@@ -68,5 +67,3 @@ struct krlimit {<br>   unsigned long rlim_cur;<br>   unsigned long rlim_max;<br>};<br>-<br>-#endif /* __CR_SYSCALL_TYPES_H__ */<br>diff --git a/include/sysctl.h b/include/sysctl.h<br>index 4a7682d..b54dacf 100644<br>--- a/include/sysctl.h<br>+++ b/include/sysctl.h<br>@@ -1,5 +1,4 @@<br>-#ifndef __CR_SYSCTL_H__<br>-#define __CR_SYSCTL_H__<br>+#pragma once<br><br>struct sysctl_req {<br>   char   *name;<br>@@ -30,5 +29,3 @@ enum {<br><br>#define CTL_LEN(t)   ((t) &gt;&gt; CTL_SHIFT)<br>#define CTL_TYPE(t)   ((t) &amp; ((1 &lt;&lt; CTL_SHIFT) - 1))<br>-<br>-#endif /* __CR_SYSCTL_H__ */<br>diff --git a/include/tty.h b/include/tty.h<br>index d2c31e2..ee3c1eb 100644<br>--- a/include/tty.h<br>+++ b/include/tty.h<br>@@ -1,5 +1,4 @@<br>-#ifndef __CR_TTY_H__<br>-#define __CR_TTY_H__<br>+#pragma once<br><br>#include "files.h"<br><br>@@ -25,5 +24,3 @@ extern int tty_prep_fds(void);<br>extern void tty_fini_fds(void);<br><br>#define OPT_SHELL_JOB   "shell-job"<br>-<br>-#endif /* __CR_TTY_H__ */<br>diff --git a/include/tun.h b/include/tun.h<br>index 9495435..6b807f3 100644<br>--- a/include/tun.h<br>+++ b/include/tun.h<br>@@ -1,5 +1,4 @@<br>-#ifndef __CR_TUN_H__<br>-#define __CR_TUN_H__<br>+#pragma once<br><br>#ifndef TUN_MINOR<br>#define TUN_MINOR   200<br>@@ -12,5 +11,3 @@ extern int dump_tun_link(NetDeviceEntry *nde, struct cr_fdset *fds);<br>extern int restore_one_tun(NetDeviceEntry *nde, int nlsk);<br>extern struct collect_image_info tunfile_cinfo;<br>extern int check_tun(void);<br>-<br>-#endif /* __CR_TUN_H__ */<br>diff --git a/include/unix_diag.h b/include/unix_diag.h<br>index 3f24683..200f5ea 100644<br>--- a/include/unix_diag.h<br>+++ b/include/unix_diag.h<br>@@ -1,5 +1,4 @@<br>-#ifndef __CR_UNIX_DIAG_H__<br>-#define __CR_UNIX_DIAG_H__<br>+#pragma once<br><br>#include "asm/types.h"<br><br>@@ -63,5 +62,3 @@ struct unix_diag_rqlen {<br>   u32   udiag_rqueue;<br>   u32   udiag_wqueue;<br>};<br>-<br>-#endif /* __CR_UNIX_DIAG_H__ */<br>diff --git a/include/util-pie.h b/include/util-pie.h<br>index cbaed42..cb0a1f4 100644<br>--- a/include/util-pie.h<br>+++ b/include/util-pie.h<br>@@ -1,5 +1,4 @@<br>-#ifndef __CR_UTIL_NET_H__<br>-#define __CR_UTIL_NET_H__<br>+#pragma once<br><br>#include &lt;sys/socket.h&gt;<br>#include &lt;sys/un.h&gt;<br>@@ -62,5 +61,3 @@ static inline int recv_fd(int sock)<br>}<br><br>extern int open_detach_mount(char *dir);<br>-<br>-#endif /* __CR_UTIL_NET_H__ */<br>diff --git a/include/util.h b/include/util.h<br>index c081921..5d1b46a 100644<br>--- a/include/util.h<br>+++ b/include/util.h<br>@@ -1,5 +1,4 @@<br>-#ifndef __CR_UTIL_H__<br>-#define __CR_UTIL_H__<br>+#pragma once<br><br>/*<br>* Some bits are stolen from perf and kvm tools<br>@@ -289,5 +288,3 @@ extern int read_fd_link(int lfd, char *buf, size_t size);<br><br>#define USEC_PER_SEC   1000000L<br>#define NSEC_PER_SEC    1000000000L<br>-<br>-#endif /* __CR_UTIL_H__ */<br>diff --git a/include/uts_ns.h b/include/uts_ns.h<br>index ff499ac..973884f 100644<br>--- a/include/uts_ns.h<br>+++ b/include/uts_ns.h<br>@@ -1,9 +1,6 @@<br>-#ifndef __CR_UTS_NS_H__<br>-#define __CR_UTS_NS_H__<br>+#pragma once<br><br>extern int dump_uts_ns(int ns_pid, int ns_id);<br>extern int prepare_utsns(int pid);<br><br>extern struct ns_desc uts_ns_desc;<br>-<br>-#endif /* __CR_UTS_NS_H__ */<br>diff --git a/include/vdso.h b/include/vdso.h<br>index 3f2f01f..90a7a1d 100644<br>--- a/include/vdso.h<br>+++ b/include/vdso.h<br>@@ -1,5 +1,4 @@<br>-#ifndef __CR_VDSO_H__<br>-#define __CR_VDSO_H__<br>+#pragma once<br><br>#include &lt;sys/mman.h&gt;<br>#include &lt;stdbool.h&gt;<br>@@ -110,5 +109,3 @@ static inline void vdso_put_mark(void *where, unsigned long proxy_addr)<br>extern struct vdso_symtable vdso_sym_rt;<br>extern u64 vdso_pfn;<br>extern int vdso_init(void);<br>-<br>-#endif /* __CR_VDSO_H__ */<br>diff --git a/include/vma.h b/include/vma.h<br>index 481b690..3410049 100644<br>--- a/include/vma.h<br>+++ b/include/vma.h<br>@@ -1,5 +1,4 @@<br>-#ifndef __CR_VMA_H__<br>-#define __CR_VMA_H__<br>+#pragma once<br><br>#include "list.h"<br>#include "protobuf/vma.pb-c.h"<br>@@ -49,5 +48,3 @@ static inline int in_vma_area(struct vma_area *vma, unsigned long addr)<br>   return addr &gt;= (unsigned long)vma-&gt;vma.start &amp;&amp;<br>      addr &lt; (unsigned long)vma-&gt;vma.end;<br>}<br>-<br>-#endif /* __CR_VMA_H__ */<br>diff --git a/include/xmalloc.h b/include/xmalloc.h<br>index a5cc608..753a450 100644<br>--- a/include/xmalloc.h<br>+++ b/include/xmalloc.h<br>@@ -1,5 +1,4 @@<br>-#ifndef __CR_XMALLOC_H__<br>-#define __CR_XMALLOC_H__<br>+#pragma once<br><br>#include &lt;stdlib.h&gt;<br>#include &lt;string.h&gt;<br>@@ -35,5 +34,3 @@<br><br>#define memzero_p(p)      memset(p, 0, sizeof(*p))<br>#define memzero(p, size)   memset(p, 0, size)<br>-<br>-#endif /* __CR_XMALLOC_H__ */<br>-- <br>1.8.5.2<br><br>_______________________________________________<br>CRIU mailing list<br><a target="_blank" href="mailto:CRIU@openvz.org">CRIU@openvz.org</a><br><a target="_blank" href="https://lists.openvz.org/mailman/listinfo/criu">https://lists.openvz.org/mailman/listinfo/criu</a></blockquote></blockquote></div></div></body></html>