提交 3f3398b2 编写于 作者: G Gymee 提交者: Gitee

move _GNU_SOURCE to build.gn and format header files as per huawei coding proactice

上级 30557155
......@@ -20,6 +20,10 @@ lite_component("init_lite") {
# feature: init
executable("init") {
defines = [
"_GNU_SOURCE", #syscall function need this macro definition
]
sources = [
"src/main.c",
"src/init_cmds.c",
......
......@@ -15,7 +15,7 @@
#ifndef BASE_STARTUP_INITLITE_ADAPTER_H
#define BASE_STARTUP_INITLITE_ADAPTER_H
#define _GNU_SOURCE // syscall function need this macro definition
#ifdef __LINUX__
#include <linux/capability.h>
#else
......
......@@ -12,8 +12,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#define _GNU_SOURCE // syscall function need this macro definition
#include "init_adapter.h"
#include <errno.h>
#include <stdio.h>
#include <unistd.h>
......
......@@ -12,7 +12,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "init_cmds.h"
#include <ctype.h>
#include <errno.h>
#include <stdio.h>
......@@ -21,6 +23,7 @@
#include <sys/mount.h>
#include <sys/stat.h>
#include <unistd.h>
#include "init_service_manager.h"
#include "securec.h"
......
......@@ -12,9 +12,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "init_jobs.h"
#include <stdio.h>
#include <string.h>
#include "init_cmds.h"
#include "securec.h"
......
......@@ -12,7 +12,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "init_read_cfg.h"
#include <errno.h>
#include <linux/capability.h>
#include <stdio.h>
......@@ -20,6 +22,7 @@
#include <string.h>
#include <sys/stat.h>
#include <unistd.h>
#include "init_jobs.h"
#include "init_perms.h"
#include "init_service_manager.h"
......
......@@ -14,12 +14,14 @@
*/
#include "init_service.h"
#include <errno.h>
#include <signal.h>
#include <stdio.h>
#include <sys/stat.h>
#include <time.h>
#include <unistd.h>
#include "init_adapter.h"
#include "init_perms.h"
......
......@@ -12,10 +12,13 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "init_service_manager.h"
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include "init_adapter.h"
#include "init_jobs.h"
......
......@@ -14,9 +14,11 @@
*/
#include "init_signal_handler.h"
#include <signal.h>
#include <stdio.h>
#include <sys/wait.h>
#include "init_service_manager.h"
static void SigHandler(int sig)
......
......@@ -12,9 +12,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include "init_read_cfg.h"
#include "init_signal_handler.h"
#include "parameter.h"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册