-diff -urpa postgresql-10.5.orig/src/bin/pg_upgrade/option.c postgresql-10.5/src/bin/pg_upgrade/option.c
---- postgresql-10.5.orig/src/bin/pg_upgrade/option.c 2018-08-22 19:57:55.237373015 +0000
-+++ postgresql-10.5/src/bin/pg_upgrade/option.c 2018-08-22 19:59:10.944372163 +0000
-@@ -460,6 +460,11 @@ get_sock_dir(ClusterInfo *cluster, bool
- cluster->sockdir = pg_malloc(MAXPGPATH);
- if (!getcwd(cluster->sockdir, MAXPGPATH))
- pg_fatal("could not determine current directory\n");
+diff -urpa postgresql-13.1.orig/src/bin/pg_upgrade/option.c postgresql-13.1/src/bin/pg_upgrade/option.c
+--- postgresql-13.1.orig/src/bin/pg_upgrade/option.c 2020-11-09 23:24:30.000000000 +0100
++++ postgresql-13.1/src/bin/pg_upgrade/option.c 2020-12-03 20:58:30.431778786 +0100
+@@ -476,8 +476,14 @@ get_sock_dir(ClusterInfo *cluster, bool
+ */
+ if (GET_MAJOR_VERSION(cluster->major_version) >= 901)
+ {
+- if (!live_check)
++ if (!live_check) {
+ cluster->sockdir = user_opts.socketdir;