mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-11 10:50:01 +01:00
Fix some gcc warnings in compiled tests.
This commit is contained in:
@@ -50,7 +50,8 @@ static void test_logf(int level, const char *format, ...)
|
|||||||
case LOG_DEBUG:
|
case LOG_DEBUG:
|
||||||
if (!_debug)
|
if (!_debug)
|
||||||
break;
|
break;
|
||||||
case LOG_NORMAL: /* fall through */
|
/* fall through */
|
||||||
|
case LOG_NORMAL:
|
||||||
fprintf(stdout, "%s", target);
|
fprintf(stdout, "%s", target);
|
||||||
break;
|
break;
|
||||||
case LOG_ERROR:
|
case LOG_ERROR:
|
||||||
@@ -121,7 +122,6 @@ int main(int argc, char **argv)
|
|||||||
{
|
{
|
||||||
int i, r;
|
int i, r;
|
||||||
void *h;
|
void *h;
|
||||||
const char *libfile = "libcryptsetup.so.12"; /* TODO import proper version */
|
|
||||||
|
|
||||||
for (i = 1; i < argc; i++) {
|
for (i = 1; i < argc; i++) {
|
||||||
if (*argv[i] != '-')
|
if (*argv[i] != '-')
|
||||||
|
|||||||
@@ -376,6 +376,9 @@ static int _setup(void)
|
|||||||
char cmd[128];
|
char cmd[128];
|
||||||
|
|
||||||
test_loop_file = strdup(THE_LFILE_TEMPLATE);
|
test_loop_file = strdup(THE_LFILE_TEMPLATE);
|
||||||
|
if (!test_loop_file)
|
||||||
|
return 1;
|
||||||
|
|
||||||
if ((fd=mkstemp(test_loop_file)) == -1) {
|
if ((fd=mkstemp(test_loop_file)) == -1) {
|
||||||
printf("cannot create temporary file with template %s\n", test_loop_file);
|
printf("cannot create temporary file with template %s\n", test_loop_file);
|
||||||
return 1;
|
return 1;
|
||||||
@@ -390,6 +393,9 @@ static int _setup(void)
|
|||||||
close(fd);
|
close(fd);
|
||||||
|
|
||||||
tmp_file_1 = strdup(THE_LFILE_TEMPLATE);
|
tmp_file_1 = strdup(THE_LFILE_TEMPLATE);
|
||||||
|
if (!tmp_file_1)
|
||||||
|
return 1;
|
||||||
|
|
||||||
if ((fd=mkstemp(tmp_file_1)) == -1) {
|
if ((fd=mkstemp(tmp_file_1)) == -1) {
|
||||||
printf("cannot create temporary file with template %s\n", tmp_file_1);
|
printf("cannot create temporary file with template %s\n", tmp_file_1);
|
||||||
return 1;
|
return 1;
|
||||||
|
|||||||
@@ -239,6 +239,9 @@ static int _setup(void)
|
|||||||
char cmd[128];
|
char cmd[128];
|
||||||
|
|
||||||
test_loop_file = strdup(THE_LFILE_TEMPLATE);
|
test_loop_file = strdup(THE_LFILE_TEMPLATE);
|
||||||
|
if (!test_loop_file)
|
||||||
|
return 1;
|
||||||
|
|
||||||
if ((fd=mkstemp(test_loop_file)) == -1) {
|
if ((fd=mkstemp(test_loop_file)) == -1) {
|
||||||
printf("cannot create temporary file with template %s\n", test_loop_file);
|
printf("cannot create temporary file with template %s\n", test_loop_file);
|
||||||
return 1;
|
return 1;
|
||||||
@@ -253,6 +256,9 @@ static int _setup(void)
|
|||||||
close(fd);
|
close(fd);
|
||||||
|
|
||||||
tmp_file_1 = strdup(THE_LFILE_TEMPLATE);
|
tmp_file_1 = strdup(THE_LFILE_TEMPLATE);
|
||||||
|
if (!tmp_file_1)
|
||||||
|
return 1;
|
||||||
|
|
||||||
if ((fd=mkstemp(tmp_file_1)) == -1) {
|
if ((fd=mkstemp(tmp_file_1)) == -1) {
|
||||||
printf("cannot create temporary file with template %s\n", tmp_file_1);
|
printf("cannot create temporary file with template %s\n", tmp_file_1);
|
||||||
return 1;
|
return 1;
|
||||||
|
|||||||
Reference in New Issue
Block a user