@@ -918,7 +918,6 @@ static int remove_subdirs(const char *root, const char *const *subdirs) {
918918
919919static int remove_machine_id_directory (const char * root ) {
920920 sd_id128_t machine_id ;
921- char buf [SD_ID128_STRING_MAX ];
922921 int r ;
923922
924923 assert (root );
@@ -931,7 +930,7 @@ static int remove_machine_id_directory(const char *root) {
931930 if (r < 0 )
932931 return log_error_errno (r , "Failed to get machine id: %m" );
933932
934- return rmdir_one (root , sd_id128_to_string (machine_id , buf ));
933+ return rmdir_one (root , SD_ID128_TO_STRING (machine_id ));
935934}
936935
937936static int remove_binaries (const char * esp_path ) {
@@ -1020,8 +1019,6 @@ static int install_loader_config(const char *esp_path) {
10201019 _cleanup_ (unlink_and_freep ) char * t = NULL ;
10211020 _cleanup_fclose_ FILE * f = NULL ;
10221021 _cleanup_close_ int fd = -1 ;
1023- sd_id128_t machine_id ;
1024- char machine_string [SD_ID128_STRING_MAX ];
10251022 const char * p ;
10261023 int r ;
10271024
@@ -1041,12 +1038,15 @@ static int install_loader_config(const char *esp_path) {
10411038
10421039 fprintf (f , "#timeout 3\n"
10431040 "#console-mode keep\n" );
1041+
10441042 if (arg_make_machine_id_directory ) {
1043+ sd_id128_t machine_id ;
1044+
10451045 r = sd_id128_get_machine (& machine_id );
10461046 if (r < 0 )
10471047 return log_error_errno (r , "Failed to get machine id: %m" );
10481048
1049- fprintf (f , "default %s-*\n" , sd_id128_to_string (machine_id , machine_string ));
1049+ fprintf (f , "default %s-*\n" , SD_ID128_TO_STRING (machine_id ));
10501050 }
10511051
10521052 r = fflush_sync_and_check (f );
@@ -1065,7 +1065,6 @@ static int install_loader_config(const char *esp_path) {
10651065
10661066static int install_machine_id_directory (const char * root ) {
10671067 sd_id128_t machine_id ;
1068- char buf [SD_ID128_STRING_MAX ];
10691068 int r ;
10701069
10711070 assert (root );
@@ -1078,7 +1077,7 @@ static int install_machine_id_directory(const char *root) {
10781077 if (r < 0 )
10791078 return log_error_errno (r , "Failed to get machine id: %m" );
10801079
1081- return mkdir_one (root , sd_id128_to_string (machine_id , buf ));
1080+ return mkdir_one (root , SD_ID128_TO_STRING (machine_id ));
10821081}
10831082
10841083static int help (int argc , char * argv [], void * userdata ) {
0 commit comments