e_info_client_screen_recorder: change default file path to '/tmp'. 69/225369/1
authorSeunghun Lee <shiin.lee@samsung.com>
Wed, 19 Feb 2020 08:37:06 +0000 (17:37 +0900)
committerSeunghun Lee <shiin.lee@samsung.com>
Wed, 19 Feb 2020 08:37:06 +0000 (17:37 +0900)
Change-Id: Ifc9c870e73de53fe939194cd23268a72081fc4da

src/bin/e_info_client_screen_recorder.c

index a96710c8d1882d93f8de7838ea040836360aa3f8..6bfdab2e622cd2694c686c481e67cc1a2b87436e 100644 (file)
@@ -150,22 +150,18 @@ _screen_recorder_efl_shutdown(void)
 static Eina_Bool
 _screen_recorder_fullpath_make_with_ext(char out[PATH_MAX], const char *filename)
 {
-   char cwd[PATH_MAX], fullname[PATH_MAX] = {0,};
+   char fullname[PATH_MAX] = {0,};
    char *dot;
    const char *ext = ".mp4";
    const char *prefix = "e-screen-record";
+   const char *default_path = "/tmp";
    int len_l, len;
 
    len_l = PATH_MAX;
    if (filename)
      {
         if (filename[0] != '/')
-          {
-             if (!getcwd(cwd, sizeof(cwd)))
-               snprintf(cwd, sizeof(cwd), "/tmp");
-
-             len = snprintf(fullname, len_l, "%s/%s", cwd, filename);
-          }
+          len = snprintf(fullname, len_l, "%s/%s", default_path, filename);
         else
           len = snprintf(fullname, len_l, "%s", filename);
 
@@ -204,11 +200,8 @@ _screen_recorder_fullpath_make_with_ext(char out[PATH_MAX], const char *filename
         if (!t)
           return EINA_FALSE;
 
-        if (!getcwd(cwd, sizeof(cwd)))
-          snprintf(cwd, sizeof(cwd), "/tmp");
-
         len = snprintf(fullname, len_l, "%s/%s-%04d%02d%02d.%02d%02d%02d",
-                       cwd, prefix,
+                       default_path, prefix,
                        t->tm_year+1900, t->tm_mon+1, t->tm_mday, t->tm_hour,
                        t->tm_min, t->tm_sec);
         len_l -= len;