Skip to content

Commit 6dd9930

Browse files
committed
remove dependency of chmod
1 parent 8635bdd commit 6dd9930

File tree

3 files changed

+4
-11
lines changed

3 files changed

+4
-11
lines changed

src/Utility/CronTab.vala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ public class CronTab : GLib.Object {
307307

308308
file_write(file_path, sh);
309309
chown(file_path, "root", "root");
310-
chmod(file_path, "644");
310+
Posix.chmod(file_path, 0644);
311311

312312
log_msg(_("Added cron task") + ": %s".printf(file_path));
313313

src/Utility/TeeJee.FileSystem.vala

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -506,11 +506,4 @@ namespace TeeJee.FileSystem{
506506

507507
return file_path.replace("'","'\\''");
508508
}
509-
510-
// dep: chmod
511-
public int chmod(string file, string permission){
512-
513-
string cmd = "chmod %s '%s'".printf(permission, escape_single_quote(file));
514-
return exec_sync (cmd, null, null);
515-
}
516509
}

src/Utility/TeeJee.Process.vala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ namespace TeeJee.ProcessHelper{
4949

5050
TEMP_DIR = tempPlace + "/timeshift-" + random_string();
5151
dir_create(TEMP_DIR);
52-
chmod(TEMP_DIR, "0750");
52+
Posix.chmod(TEMP_DIR, 0750);
5353
exec_script_sync("echo 'ok'",out std_out,out std_err, true);
5454

5555
if ((std_out == null) || (std_out.strip() != "ok")){
@@ -223,7 +223,7 @@ namespace TeeJee.ProcessHelper{
223223
script.append ("echo ${exitCode} > status\n");
224224

225225
if ((sh_path == null) || (sh_path.length == 0)){
226-
sh_path = get_temp_file_path() + ".sh";
226+
sh_path = get_temp_file_path();
227227
}
228228

229229
try{
@@ -238,7 +238,7 @@ namespace TeeJee.ProcessHelper{
238238
data_stream.close();
239239

240240
// set execute permission
241-
chmod (sh_path, "u+x");
241+
Posix.chmod (sh_path, 0744);
242242

243243
return sh_path;
244244
}

0 commit comments

Comments
 (0)