--- freem/src/fmadm.c 2025/03/22 18:43:54 1.8 +++ freem/src/fmadm.c 2025/03/24 20:13:34 1.12 @@ -1,5 +1,5 @@ /* - * $Id: fmadm.c,v 1.8 2025/03/22 18:43:54 snw Exp $ + * $Id: fmadm.c,v 1.12 2025/03/24 20:13:34 snw Exp $ * FreeM Administration Tool * * @@ -24,6 +24,18 @@ * along with FreeM. If not, see . * * $Log: fmadm.c,v $ + * Revision 1.12 2025/03/24 20:13:34 snw + * Set file permissions on freemd.exe on OS/2 in fmadm configure + * + * Revision 1.11 2025/03/24 19:25:48 snw + * Make fmadm configure copy freem.exe to freemd.exe for daemon operation on OS/2 systems + * + * Revision 1.10 2025/03/24 19:22:16 snw + * Make fmadm configure copy freem.exe to freemd.exe for daemon operation on OS/2 systems + * + * Revision 1.9 2025/03/24 19:19:42 snw + * Make fmadm configure copy freem.exe to freemd.exe for daemon operation on OS/2 systems + * * Revision 1.8 2025/03/22 18:43:54 snw * Make STRLEN 255 chars and add BIGSTR macro for larger buffers * @@ -1137,12 +1149,36 @@ void fm_configure (void) snprintf (envbase, 4095, "%s/freem/%s", SYSCONFDIR, fma_environment); snprintf (nsbase, 4095, "%s/freem/%s", LOCALSTATEDIR, fma_environment); +#if defined(__OS2__) + { + char srcfile[PATHLEN]; + char dstfile[PATHLEN]; + + snprintf (srcfile, PATHLEN, "%s/bin/freem.exe", PREFIX); + snprintf (dstfile, PATHLEN, "%s/bin/freemd.exe", PREFIX); + + unlink (dstfile); + + fprintf (stderr, "fmadm: running on OS/2; will copy %s to %s\n", srcfile, dstfile); + chmod (dstfile, 0755); + + if (cp (dstfile, srcfile) != 0) { + fprintf (stderr, "fmadm: fatal error copying %s to %s\n", srcfile, dstfile); + exit (1); + } + } +#else + fprintf (stderr, "fmadm: not running on OS/2\n"); +#endif + printf ("\nFreeM Initial Configuration\n"); printf ("---------------------------\n\n"); printf ("This utility will create the initial configuration file for "); printf ("FreeM environment '%s' in %s.\n\n", fma_environment, config_file); + + /* check for existence of needed directories */ if (stat (SYSCONFDIR, &etcstat) == -1) {