[Tizen 6.0] Support build with Glibc 2.31 85/222285/1 accepted/tizen/unified/20200114.130621 submit/tizen/20200114.003116
authorMikhail Kashkarov <m.kashkarov@partner.samsung.com>
Wed, 18 Dec 2019 09:23:41 +0000 (12:23 +0300)
committerDongkyun Son <dongkyun.s@samsung.com>
Mon, 13 Jan 2020 08:13:56 +0000 (17:13 +0900)
_IO_FILE was removed, all uses changed to FILE.

da_io_stdc.c:427:47: error: unknown type name '_IO_FILE'; did you mean '__FILE'?
  427 | HANDLER_WRAPPERS(file_feature, int, _IO_getc, _IO_FILE*, stream)

Signed-off-by: Mikhail Kashkarov <m.kashkarov@partner.samsung.com>
[Tizen 6.0] Enable build with -Wformat-truncation warning

helper/dahelper.c:94:51: error: 'snprintf' output may be truncated before the
last format character [-Werror=format-truncation=]
   94 |    snprintf(path, (size_t) MAX_PATH_LENGTH, "%s/%s",
      |                                                   ^
helper/dahelper.c:94:4: note: 'snprintf' output 2 or more bytes (assuming 257)
into a destination of size 256
   94 |    snprintf(path, (size_t) MAX_PATH_LENGTH, "%s/%s",
      |    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   95 |      dirname, entry->d_name);
      |      ~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Mikhail Kashkarov <m.kashkarov@partner.samsung.com>
new glibc

helper/dahelper.c:92:2: error: 'readdir_r' is deprecated [-Werror=deprecated-declarations]
   92 |  while ((readdir_r(dir, dirent_r, &entry) == 0) && entry) {
      |  ^~~~~
In file included from helper/dahelper.c:34:
/usr/include/dirent.h:183:12: note: declared here
  183 | extern int readdir_r (DIR *__restrict __dirp,

Change-Id: I82a75663c9a9175da3656de64e7d0b67381bc460

helper/dahelper.c
probe_file/da_io_stdc.c

index d7079d4de21472340113bbfa33b76d63eec09a48..169172a9031b8ba505d3c55333ecade309b6d995 100755 (executable)
@@ -81,21 +81,19 @@ int remove_indir(const char *dirname)
 {
        DIR *dir;
        struct dirent *entry;
-       char path[MAX_PATH_LENGTH];
-       static char dirent_buffer[sizeof(struct dirent) + PATH_MAX + 1] = {0,};
-       static struct dirent *dirent_r = (struct dirent *)dirent_buffer;
+       char path[MAX_PATH_LENGTH + 1]; /* Add +1 for '%s/%s' format*/
 
        dir = opendir(dirname);
        if (dir == NULL)
                return -1;
 
-       while ((readdir_r(dir, dirent_r, &entry) == 0) && entry) {
+       while ((entry = readdir(dir))) {
                if (strcmp(entry->d_name, ".") && strcmp(entry->d_name, "..")) {
-                       snprintf(path, (size_t) MAX_PATH_LENGTH, "%s/%s",
+                       snprintf(path, sizeof(path), "%s/%s",
                                 dirname, entry->d_name);
                        if (entry->d_type != DT_DIR)
                                unlink(path);
-               }
+         }
        }
        closedir(dir);
 
index 886d8fe10e1ce9fc5e20d02195f8b59d1cb35924..030400df57c9e687412cdb860a0b0d7810bea612 100644 (file)
@@ -424,9 +424,9 @@ HANDLER_WRAPPERS(file_feature, int, getc, FILE*, stream)
        return ret;
 }
 
-HANDLER_WRAPPERS(file_feature, int, _IO_getc, _IO_FILE*, stream)
+HANDLER_WRAPPERS(file_feature, int, _IO_getc, FILE*, stream)
 {
-       int (*getcp)(_IO_FILE* stream);
+       int (*getcp)(FILE* stream);
 
        BEFORE_ORIGINAL_START_END_FILEP(API_ID_getc, 'd', _IO_getc, LIBC,
                                        stream, FD_API_READ_START, "p",
@@ -460,9 +460,9 @@ HANDLER_WRAPPERS(file_feature, int, putc, int, character, FILE*, stream)
        return ret;
 }
 
-HANDLER_WRAPPERS(file_feature, int, _IO_putc, int, character, _IO_FILE*, stream)
+HANDLER_WRAPPERS(file_feature, int, _IO_putc, int, character, FILE*, stream)
 {
-       int (*_IO_putcp)(int character, _IO_FILE* stream);
+       int (*_IO_putcp)(int character, FILE* stream);
 
        BEFORE_ORIGINAL_START_END_FILEP(API_ID_putc, 'd', _IO_putc, LIBC,
                                        stream, FD_API_WRITE_START, "dp",