Skip to content

Commit cc5d85b

Browse files
authored
[Actions][Linux] Add more extensions to be built, fix all compile warnings and errors (#2039)
* Fix compile warnings and errors in the extensions to add them to Actions * Add more extensions to be built and sort all of them * Update Thunder job to use development branch * Fix compile warnings in the CheckPointServer.c * One more strncpy warning fixed * Update Thunder workflow to use master branch
1 parent a01bd71 commit cc5d85b

File tree

5 files changed

+23
-18
lines changed

5 files changed

+23
-18
lines changed

.github/workflows/Linux build template.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -153,17 +153,20 @@ jobs:
153153
-DPROXYSTUB_PATH="${PWD}/${{matrix.build_type}}/install/usr/lib/wpeframework/proxystubs" \
154154
-DSYSTEM_PATH="${PWD}/${{matrix.build_type}}/install/usr/lib/wpeframework/plugins" \
155155
-DVOLATILE_PATH="tmp" \
156-
-DBLUETOOTH_SUPPORT=ON \
157156
-DBLUETOOTH=ON \
158-
-DDOWNLOAD_BLUEZ_UTIL_HEADERS=ON \
159157
-DBLUETOOTH_AUDIO_SUPPORT=ON \
160158
-DBLUETOOTH_GATT_SUPPORT=ON \
159+
-DBLUETOOTH_SUPPORT=ON \
160+
-DBROADCAST=ON \
161+
-DDOWNLOAD_BLUEZ_UTIL_HEADERS=ON \
162+
-DHIBERNATESUPPORT=ON \
163+
-DHIBERNATE_CHECKPOINTSERVER=ON \
161164
-DLOCALTRACER=ON \
162-
-DWARNING_REPORTING=ON \
165+
-DPERFORMANCE_MONITOR=ON \
166+
-DPRIVILEGEDREQUEST=ON \
163167
-DPROCESSCONTAINERS=ON \
164168
-DPROCESSCONTAINERS_RUNC=ON \
165-
-DBROADCAST=ON \
166-
-DPERFORMANCE_MONITOR=ON \
169+
-DWARNING_REPORTING=ON \
167170
${{steps.regexthunder.outputs.first_match}}
168171
cmake --build ${{matrix.build_type}}/build/Thunder --target install
169172

Source/extensions/hibernate/checkpointserver/CheckpointServer.c

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323

2424
#include <arpa/inet.h>
2525
#include <assert.h>
26+
#include <errno.h>
2627
#include <stdbool.h>
2728
#include <stdlib.h>
2829
#include <sys/socket.h>
@@ -79,7 +80,8 @@ static int Connect(const char* serverLocator, uint32_t timeoutMs)
7980
}
8081

8182
addrUn.sun_family = PF_UNIX;
82-
strncpy(addrUn.sun_path, serverLocator, sizeof(addrUn.sun_path));
83+
strncpy(addrUn.sun_path, serverLocator, sizeof(addrUn.sun_path) - 1);
84+
addrUn.sun_path[sizeof(addrUn.sun_path) - 1] = '\0';
8385
addr = (struct sockaddr*)&addrUn;
8486
addrSize = sizeof(struct sockaddr_un);
8587
} else {
@@ -90,11 +92,12 @@ static int Connect(const char* serverLocator, uint32_t timeoutMs)
9092
return -1;
9193
}
9294

93-
strncpy(host, serverLocator, 64);
95+
strncpy(host, serverLocator, sizeof(host) - 1);
96+
host[sizeof(host) - 1] = '\0';
9497
port = strstr(host, ":");
9598
if (port == NULL) {
9699
LOGERR("Invalid Server Ip Address: %s", host);
97-
return false;
100+
return -1;
98101
}
99102

100103
// Add NULL delimer between host and port
@@ -125,7 +128,6 @@ static bool SendRcvCmd(const ServerRequest* cmd, ServerResponse* resp, uint32_t
125128
{
126129
int cd;
127130
int ret;
128-
struct sockaddr_in addr = { 0 };
129131
resp->respCode = MEMCR_ERROR;
130132

131133
cd = Connect(serverLocator, timeoutMs);
@@ -136,14 +138,14 @@ static bool SendRcvCmd(const ServerRequest* cmd, ServerResponse* resp, uint32_t
136138

137139
ret = write(cd, cmd, sizeof(ServerRequest));
138140
if (ret != sizeof(ServerRequest)) {
139-
LOGERR("Socket write failed: ret %d, %m", ret);
141+
LOGERR("Socket write failed: ret %d, errno %d", ret, errno);
140142
close(cd);
141143
return false;
142144
}
143145

144146
ret = read(cd, resp, sizeof(ServerResponse));
145147
if (ret != sizeof(ServerResponse)) {
146-
LOGERR("Socket read failed: ret %d, %m", ret);
148+
LOGERR("Socket read failed: ret %d, errno %d", ret, errno);
147149
resp->respCode = MEMCR_SOCKET_READ_ERROR;
148150
close(cd);
149151
return false;
@@ -154,7 +156,7 @@ static bool SendRcvCmd(const ServerRequest* cmd, ServerResponse* resp, uint32_t
154156
return (resp->respCode == MEMCR_OK);
155157
}
156158

157-
uint32_t HibernateProcess(const uint32_t timeout, const pid_t pid, const char data_dir[], const char volatile_dir[], void** storage)
159+
uint32_t HibernateProcess(const uint32_t timeout, const pid_t pid, const char data_dir[], const char volatile_dir[] __attribute__((unused)), void** storage __attribute__((unused)))
158160
{
159161
ServerRequest req = {
160162
.reqCode = MEMCR_CHECKPOINT,
@@ -174,7 +176,7 @@ uint32_t HibernateProcess(const uint32_t timeout, const pid_t pid, const char da
174176
}
175177
}
176178

177-
uint32_t WakeupProcess(const uint32_t timeout, const pid_t pid, const char data_dir[], const char volatile_dir[], void** storage)
179+
uint32_t WakeupProcess(const uint32_t timeout, const pid_t pid, const char data_dir[], const char volatile_dir[] __attribute__((unused)), void** storage __attribute__((unused)))
178180
{
179181
ServerRequest req = {
180182
.reqCode = MEMCR_RESTORE,

Source/extensions/hibernate/common/Log.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@
66
#define MODULE "Hibernate"
77
#endif
88

9-
#define LOGINFO(fmt, ...) do { fprintf(stdout, MODULE " [%s:%d] " fmt "\n", __FUNCTION__, __LINE__, ##__VA_ARGS__);fflush(stdout); } while (0)
10-
#define LOGERR(fmt, ...) do { fprintf(stderr, MODULE " [%s:%d] " fmt "\n", __FUNCTION__, __LINE__, ##__VA_ARGS__);fflush(stderr); } while (0)
9+
#define LOGINFO(fmt, ...) do { fprintf(stdout, MODULE " [%s:%d] " fmt "\n", __func__, __LINE__, ##__VA_ARGS__);fflush(stdout); } while (0)
10+
#define LOGERR(fmt, ...) do { fprintf(stderr, MODULE " [%s:%d] " fmt "\n", __func__, __LINE__, ##__VA_ARGS__);fflush(stderr); } while (0)

Source/extensions/privilegedrequest/include/privilegedrequest/PrivilegedRequest.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -335,9 +335,9 @@ namespace Core {
335335
}
336336

337337
ASSERT(strlen(binder) < MaxFilePathLength);
338-
338+
PUSH_WARNING(DISABLE_WARNING_UNUSED_RESULT)
339339
::mkstemp(binder);
340-
340+
POP_WARNING()
341341
return (string(binder));
342342
}
343343
int OpenDomainSocket(const string& connector) const

Source/plugins/IController.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ namespace Controller {
262262
enum extensiontype : uint8_t {
263263
WARNING_REPORTING = 1,
264264
BLUETOOTH = 2,
265-
HIBERBATE = 4,
265+
HIBERNATE = 4,
266266
PROCESS_CONTAINERS = 8
267267
};
268268

0 commit comments

Comments
 (0)