Message ID | 20220824094029.1634519-12-bmeng.cn@gmail.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | tests/qtest: Enable running qtest on Windows | expand |
Reviewed-by: Konstantin Kostiuk <kkostiuk@redhat.com> On Wed, Aug 24, 2022 at 12:42 PM Bin Meng <bmeng.cn@gmail.com> wrote: > From: Bin Meng <bin.meng@windriver.com> > > g_mkdir() is a deprecated API and newer codes should use > g_mkdir_with_parents(). > > Signed-off-by: Bin Meng <bin.meng@windriver.com> > --- > > qga/commands-posix-ssh.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/qga/commands-posix-ssh.c b/qga/commands-posix-ssh.c > index f3a580b8cc..2460112a38 100644 > --- a/qga/commands-posix-ssh.c > +++ b/qga/commands-posix-ssh.c > @@ -59,7 +59,7 @@ static bool > mkdir_for_user(const char *path, const struct passwd *p, > mode_t mode, Error **errp) > { > - if (g_mkdir(path, mode) == -1) { > + if (g_mkdir_with_parents(path, mode) == -1) { > error_setg(errp, "failed to create directory '%s': %s", > path, g_strerror(errno)); > return false; > -- > 2.34.1 > >
On Wed, Aug 24, 2022 at 10:41 PM Konstantin Kostiuk <kkostiuk@redhat.com> wrote: > > Reviewed-by: Konstantin Kostiuk <kkostiuk@redhat.com> > > On Wed, Aug 24, 2022 at 12:42 PM Bin Meng <bmeng.cn@gmail.com> wrote: >> >> From: Bin Meng <bin.meng@windriver.com> >> >> g_mkdir() is a deprecated API and newer codes should use >> g_mkdir_with_parents(). >> >> Signed-off-by: Bin Meng <bin.meng@windriver.com> >> --- >> >> qga/commands-posix-ssh.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> I was wrong that g_mkdir() is deprecated. I must have been misled by the GTK glib doc. Using g_mkdir() is still fine so this patch can be dropped. Sorry about that. Regards, Bin
diff --git a/qga/commands-posix-ssh.c b/qga/commands-posix-ssh.c index f3a580b8cc..2460112a38 100644 --- a/qga/commands-posix-ssh.c +++ b/qga/commands-posix-ssh.c @@ -59,7 +59,7 @@ static bool mkdir_for_user(const char *path, const struct passwd *p, mode_t mode, Error **errp) { - if (g_mkdir(path, mode) == -1) { + if (g_mkdir_with_parents(path, mode) == -1) { error_setg(errp, "failed to create directory '%s': %s", path, g_strerror(errno)); return false;