@@ -480,7 +480,7 @@ libcrun_container_checkpoint_linux_criu (libcrun_container_status_t *status, lib
480
480
{
481
481
ret = mkdir (cr_options -> work_path , 0700 );
482
482
if (UNLIKELY ((ret == -1 ) && (errno != EEXIST )))
483
- return crun_make_error (err , errno , "error creating CRIU work directory `%s`" , cr_options -> image_path );
483
+ return crun_make_error (err , errno , "error creating CRIU work directory `%s`" , cr_options -> work_path );
484
484
485
485
work_fd = open (cr_options -> work_path , O_DIRECTORY | O_CLOEXEC );
486
486
if (UNLIKELY (work_fd == -1 ))
@@ -861,6 +861,10 @@ libcrun_container_restore_linux_criu (libcrun_container_status_t *status, libcru
861
861
* crun to set it if the user has not selected a specific directory. */
862
862
if (cr_options -> work_path != NULL )
863
863
{
864
+ ret = mkdir (cr_options -> work_path , 0700 );
865
+ if (UNLIKELY ((ret == -1 ) && (errno != EEXIST )))
866
+ return crun_make_error (err , errno , "error creating CRIU work directory `%s`" , cr_options -> work_path );
867
+
864
868
work_fd = open (cr_options -> work_path , O_DIRECTORY | O_CLOEXEC );
865
869
if (UNLIKELY (work_fd == -1 ))
866
870
return crun_make_error (err , errno , "error opening CRIU work directory `%s`" , cr_options -> work_path );
0 commit comments