[hipl-dev] Re: [Merge] lp:~hipl-core/hipl/libhip into lp:hipl
- From: Christof Mroz <christof.mroz@xxxxxxxxxxxxxx>
- To: hipl-dev@xxxxxxxxxxxxx
- Date: Tue, 17 Apr 2012 18:40:09 +0200
On 17.04.2012 18:16, Xin wrote:
On 19/03/12 16:59, Diego Biurrun wrote:> review needs-fixing > >>> --- lib/core/hostid.c 2012-03-01 14:26:43 +0000 >> +++ lib/core/hostid.c 2012-03-15 08:58:36 +0000 >> @@ -678,6 +679,7 @@ >> int dsa_pub_key_rr_len = 0, rsa_pub_key_rr_len = 0; >> hip_hdr numeric_action = 0; >> + char *hi_file_dup = NULL; >> char hostname[HIP_HOST_ID_HOSTNAME_LEN_MAX]; >> @@ -743,11 +745,16 @@ >> goto out_err; >> } >> } else if (!use_default) { >> + hi_file_dup = strdup(hi_file); >> + if ((err = check_and_create_dir(dirname(hi_file_dup), HIP_DIR_MODE))) { >> + HIP_ERROR("Could not create direcory for path: %s\n", hi_file); >> + goto out_err;> You strup - why?the function dirname() might modify the parameter, so I copy it.
This is ok now, but tucking the strdup() and dirname() away into check_and_create_dir() could be less distracting and reusable. I'm not sure.
- References:
Other related posts:
- » [hipl-dev] Re: [Merge] lp:~hipl-core/hipl/libhip into lp:hipl - Miika Komu
- » [hipl-dev] [Merge] lp:~hipl-core/hipl/libhip into lp:hipl - Xin
- » [hipl-dev] Re: [Merge] lp:~hipl-core/hipl/libhip into lp:hipl - Diego Biurrun
- » [hipl-dev] Re: [Merge] lp:~hipl-core/hipl/libhip into lp:hipl - Miika Komu
- » [hipl-dev] Re: [Merge] lp:~hipl-core/hipl/libhip into lp:hipl - Xin Gu
- » [hipl-dev] Re: [Merge] lp:~hipl-core/hipl/libhip into lp:hipl - Diego Biurrun
- » [hipl-dev] Re: [Merge] lp:~hipl-core/hipl/libhip into lp:hipl - Xin Gu
- » [hipl-dev] Re: [Merge] lp:~hipl-core/hipl/libhip into lp:hipl - Miika Komu
- » [hipl-dev] [Merge] lp:~hipl-core/hipl/libhip into lp:hipl - Xin
- » [hipl-dev] Re: [Merge] lp:~hipl-core/hipl/libhip into lp:hipl - Diego Biurrun
- » [hipl-dev] Re: [Merge] lp:~hipl-core/hipl/libhip into lp:hipl - Xin Gu
- » [hipl-dev] Re: [Merge] lp:~hipl-core/hipl/libhip into lp:hipl - Diego Biurrun
- » [hipl-dev] [Merge] lp:~hipl-core/hipl/libhip into lp:hipl - Xin
- » [hipl-dev] Re: [Merge] lp:~hipl-core/hipl/libhip into lp:hipl - Diego Biurrun
- » [hipl-dev] Re: [Merge] lp:~hipl-core/hipl/libhip into lp:hipl - Diego Biurrun
- » [hipl-dev] Re: [Merge] lp:~hipl-core/hipl/libhip into lp:hipl - Xin Gu
- » [hipl-dev] Re: [Merge] lp:~hipl-core/hipl/libhip into lp:hipl - Diego Biurrun
- » [hipl-dev] Re: [Merge] lp:~hipl-core/hipl/libhip into lp:hipl - Miika Komu
- » [hipl-dev] Re: [Merge] lp:~hipl-core/hipl/libhip into lp:hipl - Diego Biurrun
- » [hipl-dev] Re: [Merge] lp:~hipl-core/hipl/libhip into lp:hipl - Miika Komu
- » [hipl-dev] Re: [Merge] lp:~hipl-core/hipl/libhip into lp:hipl - Xin Gu
- » [hipl-dev] Re: [Merge] lp:~hipl-core/hipl/libhip into lp:hipl - Xin Gu
- » [hipl-dev] Re: [Merge] lp:~hipl-core/hipl/libhip into lp:hipl - Diego Biurrun
- » [hipl-dev] Re: [Merge] lp:~hipl-core/hipl/libhip into lp:hipl - Xin Gu
- » [hipl-dev] Re: [Merge] lp:~hipl-core/hipl/libhip into lp:hipl - Diego Biurrun
- » [hipl-dev] Re: [Merge] lp:~hipl-core/hipl/libhip into lp:hipl - Christof Mroz
- » [hipl-dev] Re: [Merge] lp:~hipl-core/hipl/libhip into lp:hipl - Christof Mroz
- » [hipl-dev] Re: [Merge] lp:~hipl-core/hipl/libhip into lp:hipl - Xin Gu
- » [hipl-dev] Re: [Merge] lp:~hipl-core/hipl/libhip into lp:hipl - Diego Biurrun
- » [hipl-dev] Re: [Merge] lp:~hipl-core/hipl/libhip into lp:hipl - Xin Gu
- » [hipl-dev] Re: [Merge] lp:~hipl-core/hipl/libhip into lp:hipl - Xin
- » [hipl-dev] Re: [Merge] lp:~hipl-core/hipl/libhip into lp:hipl - Diego Biurrun
- » [hipl-dev] Re: [Merge] lp:~hipl-core/hipl/libhip into lp:hipl - Christof Mroz
- » [hipl-dev] [Merge] lp:~hipl-core/hipl/libhip into lp:hipl - Xin
- » [hipl-dev] [Merge] lp:~hipl-core/hipl/libhip into lp:hipl - Xin
- » [hipl-dev] Re: [Merge] lp:~hipl-core/hipl/libhip into lp:hipl - Christof Mroz
- » [hipl-dev] Re: [Merge] lp:~hipl-core/hipl/libhip into lp:hipl - Diego Biurrun
- » [hipl-dev] Re: [Merge] lp:~hipl-core/hipl/libhip into lp:hipl - Christof Mroz
- » [hipl-dev] Re: [Merge] lp:~hipl-core/hipl/libhip into lp:hipl - Miika Komu
- » [hipl-dev] Re: [Merge] lp:~hipl-core/hipl/libhip into lp:hipl - Diego Biurrun
- » [hipl-dev] Re: [Merge] lp:~hipl-core/hipl/libhip into lp:hipl - Xin Gu
- » [hipl-dev] Re: [Merge] lp:~hipl-core/hipl/libhip into lp:hipl - Diego Biurrun
- » [hipl-dev] Re: [Merge] lp:~hipl-core/hipl/libhip into lp:hipl - Xin Gu
- » [hipl-dev] Re: [Merge] lp:~hipl-core/hipl/libhip into lp:hipl - Xin Gu
- » [hipl-dev] Re: [Merge] lp:~hipl-core/hipl/libhip into lp:hipl - Christof Mroz
- » [hipl-dev] Re: [Merge] lp:~hipl-core/hipl/libhip into lp:hipl - Diego Biurrun
- » [hipl-dev] Re: [Merge] lp:~hipl-core/hipl/libhip into lp:hipl - Miika Komu
- » [hipl-dev] Re: [Merge] lp:~hipl-core/hipl/libhip into lp:hipl - Diego Biurrun
- » [hipl-dev] Re: [Merge] lp:~hipl-core/hipl/libhip into lp:hipl - Miika Komu
- » [hipl-dev] Re: [Merge] lp:~hipl-core/hipl/libhip into lp:hipl - Stefan Götz
- » [hipl-dev] Re: [Merge] lp:~hipl-core/hipl/libhip into lp:hipl - Christof Mroz
- » [hipl-dev] Re: [Merge] lp:~hipl-core/hipl/libhip into lp:hipl - Miika Komu
- » [hipl-dev] Re: [Merge] lp:~hipl-core/hipl/libhip into lp:hipl - Diego Biurrun
- » [hipl-dev] Re: [Merge] lp:~hipl-core/hipl/libhip into lp:hipl - Xin Gu
- » [hipl-dev] Re: [Merge] lp:~hipl-core/hipl/libhip into lp:hipl - Xin Gu
- » [hipl-dev] Re: [Merge] lp:~hipl-core/hipl/libhip into lp:hipl - Stefan Götz
- » [hipl-dev] Re: [Merge] lp:~hipl-core/hipl/libhip into lp:hipl - Miika Komu
- » [hipl-dev] Re: [Merge] lp:~hipl-core/hipl/libhip into lp:hipl - Stefan Götz
- » [hipl-dev] Re: [Merge] lp:~hipl-core/hipl/libhip into lp:hipl - Diego Biurrun
- » [hipl-dev] Re: [Merge] lp:~hipl-core/hipl/libhip into lp:hipl - David Martin
- » [hipl-dev] Re: [Merge] lp:~hipl-core/hipl/libhip into lp:hipl - David Martin
- » [hipl-dev] Re: [Merge] lp:~hipl-core/hipl/libhip into lp:hipl - Diego Biurrun
- » [hipl-dev] Re: [Merge] lp:~hipl-core/hipl/libhip into lp:hipl - Xin Gu
- » [hipl-dev] Re: [Merge] lp:~hipl-core/hipl/libhip into lp:hipl - Miika Komu
- » [hipl-dev] Re: [Merge] lp:~hipl-core/hipl/libhip into lp:hipl - Miika Komu
- » [hipl-dev] Re: [Merge] lp:~hipl-core/hipl/libhip into lp:hipl - Stefan Götz
- » [hipl-dev] Re: [Merge] lp:~hipl-core/hipl/libhip into lp:hipl - Xin Gu
- » [hipl-dev] Re: [Merge] lp:~hipl-core/hipl/libhip into lp:hipl - Diego Biurrun
- » [hipl-dev] Re: [Merge] lp:~hipl-core/hipl/libhip into lp:hipl - Diego Biurrun
- » [hipl-dev] Re: [Merge] lp:~hipl-core/hipl/libhip into lp:hipl - Xin Gu
- » [hipl-dev] Re: [Merge] lp:~hipl-core/hipl/libhip into lp:hipl - Diego Biurrun
- » [hipl-dev] Re: [Merge] lp:~hipl-core/hipl/libhip into lp:hipl - Xin Gu
- » [hipl-dev] Re: [Merge] lp:~hipl-core/hipl/libhip into lp:hipl - Stefan Götz
- » [hipl-dev] Re: [Merge] lp:~hipl-core/hipl/libhip into lp:hipl - Xin Gu
- » [hipl-dev] Re: [Merge] lp:~hipl-core/hipl/libhip into lp:hipl - Xin Gu
- » [hipl-dev] Re: [Merge] lp:~hipl-core/hipl/libhip into lp:hipl - Stefan Götz
- » [hipl-dev] Re: [Merge] lp:~hipl-core/hipl/libhip into lp:hipl - Miika Komu
- » [hipl-dev] Re: [Merge] lp:~hipl-core/hipl/libhip into lp:hipl - Diego Biurrun
- » [hipl-dev] Re: [Merge] lp:~hipl-core/hipl/libhip into lp:hipl - Xin Gu
- » [hipl-dev] Re: [Merge] lp:~hipl-core/hipl/libhip into lp:hipl - Diego Biurrun
- » [hipl-dev] [Merge] lp:~hipl-core/hipl/libhip into lp:hipl - Xin
- » [hipl-dev] [Merge] lp:~hipl-core/hipl/libhip into lp:hipl - Xin
- » [hipl-dev] Re: [Merge] lp:~hipl-core/hipl/libhip into lp:hipl - Christof Mroz
- » [hipl-dev] Re: [Merge] lp:~hipl-core/hipl/libhip into lp:hipl - René Hummen
- » [hipl-dev] Re: [Merge] lp:~hipl-core/hipl/libhip into lp:hipl - Miika Komu
- » [hipl-dev] Re: [Merge] lp:~hipl-core/hipl/libhip into lp:hipl - Diego Biurrun
- » [hipl-dev] Re: [Merge] lp:~hipl-core/hipl/libhip into lp:hipl - Xin Gu
- » [hipl-dev] Re: [Merge] lp:~hipl-core/hipl/libhip into lp:hipl - Diego Biurrun
- » [hipl-dev] [Merge] lp:~hipl-core/hipl/libhip into lp:hipl - Xin
- » [hipl-dev] [Merge] lp:~hipl-core/hipl/libhip into lp:hipl - Xin
- » [hipl-dev] Re: [Merge] lp:~hipl-core/hipl/libhip into lp:hipl - Xin Gu
- » [hipl-dev] Re: [Merge] lp:~hipl-core/hipl/libhip into lp:hipl - Christof Mroz
- » [hipl-dev] Re: [Merge] lp:~hipl-core/hipl/libhip into lp:hipl - Christof Mroz
- » [hipl-dev] Re: [Merge] lp:~hipl-core/hipl/libhip into lp:hipl - Miika Komu
- » [hipl-dev] Re: [Merge] lp:~hipl-core/hipl/libhip into lp:hipl - Miika Komu
- » [hipl-dev] Re: [Merge] lp:~hipl-core/hipl/libhip into lp:hipl - Miika Komu
- » [hipl-dev] Re: [Merge] lp:~hipl-core/hipl/libhip into lp:hipl - Xin Gu
- » [hipl-dev] Re: [Merge] lp:~hipl-core/hipl/libhip into lp:hipl - Miika Komu
- » [hipl-dev] Re: [Merge] lp:~hipl-core/hipl/libhip into lp:hipl - Miika Komu
- » [hipl-dev] Re: [Merge] lp:~hipl-core/hipl/libhip into lp:hipl - Diego Biurrun
- » [hipl-dev] Re: [Merge] lp:~hipl-core/hipl/libhip into lp:hipl - Xin Gu
- » [hipl-dev] Re: [Merge] lp:~hipl-core/hipl/libhip into lp:hipl - Diego Biurrun
- » [hipl-dev] Re: [Merge] lp:~hipl-core/hipl/libhip into lp:hipl - Miika Komu
- » [hipl-dev] Re: [Merge] lp:~hipl-core/hipl/libhip into lp:hipl - Xin Gu
- » [hipl-dev] Re: [Merge] lp:~hipl-core/hipl/libhip into lp:hipl - Diego Biurrun
- » [hipl-dev] Re: [Merge] lp:~hipl-core/hipl/libhip into lp:hipl - Xin Gu
- » [hipl-dev] [Merge] lp:~hipl-core/hipl/libhip into lp:hipl - Xin
- » [hipl-dev] [Merge] lp:~hipl-core/hipl/libhip into lp:hipl - Xin
- » [hipl-dev] Re: [Merge] lp:~hipl-core/hipl/libhip into lp:hipl - Miika Komu
- » [hipl-dev] Re: [Merge] lp:~hipl-core/hipl/libhip into lp:hipl - Diego Biurrun
- » [hipl-dev] [Merge] lp:~hipl-core/hipl/libhip into lp:hipl - noreply