From: David Goulet Date: Mon, 16 Jan 2012 17:00:24 +0000 (-0500) Subject: Move runas.h to common/ directory X-Git-Tag: v2.0-pre17~13 X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=commitdiff_plain;h=0857097f7cd49f503c966eb42716415dd5540352 Move runas.h to common/ directory Simply put to improve semantic over the code includes and knowing that runas.h comes from the common library. It's arguable to do this across the code base for all internal libraries. This should be discuss at least for the code tree consistency. Signed-off-by: David Goulet --- diff --git a/common/runas.c b/common/runas.c index b3fa81469..22bd2fe8f 100644 --- a/common/runas.c +++ b/common/runas.c @@ -32,6 +32,8 @@ #include +#include "runas.h" + #define CHILD_STACK_SIZE 10485760 struct run_as_data { diff --git a/common/runas.h b/common/runas.h new file mode 100644 index 000000000..544653d65 --- /dev/null +++ b/common/runas.h @@ -0,0 +1,29 @@ +#ifndef _RUNAS_H +#define _RUNAS_H + +/* + * Copyright (C) 2011 - David Goulet + * Mathieu Desnoyers + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; only verion 2 + * of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#include + +int mkdir_recursive_run_as(const char *path, mode_t mode, uid_t uid, gid_t gid); +int mkdir_run_as(const char *path, mode_t mode, uid_t uid, gid_t gid); +int open_run_as(const char *path, int flags, mode_t mode, uid_t uid, gid_t gid); + +#endif /* _RUNAS_H */ diff --git a/include/Makefile.am b/include/Makefile.am index 00120a6a0..fd212f22f 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -2,4 +2,4 @@ lttnginclude_HEADERS = lttng/lttng.h lttng/lttng-kconsumer.h \ lttng/lttng-ustconsumer.h lttng/lttng-consumer.h noinst_HEADERS = lttngerr.h lttng-kernel.h lttng-consumerd.h lttng-share.h \ - lttng-sessiond-comm.h lttng-kernel-ctl.h lttng-ht.h runas.h + lttng-sessiond-comm.h lttng-kernel-ctl.h lttng-ht.h diff --git a/include/runas.h b/include/runas.h deleted file mode 100644 index 544653d65..000000000 --- a/include/runas.h +++ /dev/null @@ -1,29 +0,0 @@ -#ifndef _RUNAS_H -#define _RUNAS_H - -/* - * Copyright (C) 2011 - David Goulet - * Mathieu Desnoyers - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; only verion 2 - * of the License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#include - -int mkdir_recursive_run_as(const char *path, mode_t mode, uid_t uid, gid_t gid); -int mkdir_run_as(const char *path, mode_t mode, uid_t uid, gid_t gid); -int open_run_as(const char *path, int flags, mode_t mode, uid_t uid, gid_t gid); - -#endif /* _RUNAS_H */ diff --git a/liblttng-kconsumer/lttng-kconsumer.c b/liblttng-kconsumer/lttng-kconsumer.c index 388cc5b20..2b69438ca 100644 --- a/liblttng-kconsumer/lttng-kconsumer.c +++ b/liblttng-kconsumer/lttng-kconsumer.c @@ -33,7 +33,8 @@ #include #include #include -#include + +#include "common/runas.h" extern struct lttng_consumer_global_data consumer_data; extern int consumer_poll_timeout; diff --git a/liblttng-ustconsumer/lttng-ustconsumer.c b/liblttng-ustconsumer/lttng-ustconsumer.c index 8305b061a..bc262572a 100644 --- a/liblttng-ustconsumer/lttng-ustconsumer.c +++ b/liblttng-ustconsumer/lttng-ustconsumer.c @@ -33,7 +33,8 @@ #include #include #include -#include + +#include "common/runas.h" extern struct lttng_consumer_global_data consumer_data; extern int consumer_poll_timeout; diff --git a/lttng-sessiond/main.c b/lttng-sessiond/main.c index f7cd81027..6f34bb722 100644 --- a/lttng-sessiond/main.c +++ b/lttng-sessiond/main.c @@ -44,7 +44,7 @@ #include #include -#include +#include "common/runas.h" #include "channel.h" #include "compat/poll.h" diff --git a/lttng-sessiond/session.c b/lttng-sessiond/session.c index cccb43b74..050942cee 100644 --- a/lttng-sessiond/session.c +++ b/lttng-sessiond/session.c @@ -27,8 +27,8 @@ #include #include -#include +#include "common/runas.h" #include "session.h" /* diff --git a/lttng-sessiond/ust-app.c b/lttng-sessiond/ust-app.c index 913d2de27..209a7fed4 100644 --- a/lttng-sessiond/ust-app.c +++ b/lttng-sessiond/ust-app.c @@ -25,15 +25,14 @@ #include #include #include -#include #include #include #include #include -#include +#include "common/runas.h" #include "ust-app.h" #include "ust-consumer.h" #include "ust-ctl.h"