iicpbmp.c revision fcf3ce441efd61da9bb2884968af01cb7c1452cc
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#include <errno.h>
#include <signal.h>
#include <stdio.h>
#include <string.h>
#include <fcntl.h>
#include <stdlib.h>
#include <unistd.h>
#include <values.h>
#include <locale.h>
#include <strings.h>
#include <stdarg.h>
#include <nsctl.h>
#define DSW_TEXT_DOMAIN "II"
void iicpbmp_usage();
void copybmp(char *, char *);
int find_bitmap_cfg(char *);
extern int optind;
char *cmdnam;
extern char *optarg;
int update_cfg = 1;
char shadow[DSW_NAMELEN];
char buf[CFG_MAX_BUF];
char key[CFG_MAX_KEY];
int setnumber;
#ifdef lint
int
#else
int
#endif
{
if (argc > 1) {
/* don't update cfg information */
update_cfg = 0;
argc--;
argv++;
}
}
if (update_cfg) {
exit(1);
}
"iicpbmp CFG_WRLOCK failed, errno %d", errno);
exit(1);
}
}
if (update_cfg)
exit(0);
return (0);
}
void
{
exit(1);
}
void
{
int i;
int dsw_fd;
char cp_buffer[256];
if (dsw_fd < 0) {
exit(1);
}
"Both old and new bitmap file names must begin with a /.\n"));
exit(1);
}
exit(1);
}
exit(1);
}
"set first\n"));
exit(1);
}
exit(1);
}
/* Check old header looks like an Point-in-Time Copy bitmap header */
exit(1);
}
"bitmap.\n"), old_bitmap);
exit(1);
}
"%s has Point-in-Time Copy bitmap magic number,\n"
"but does not contain correct data.\n"), old_bitmap);
exit(1);
}
exit(1);
}
/* Set up new header */
exit(1);
}
/* Copy the bitmap itself */
> 0) {
break;
}
}
if (update_cfg) {
< 0) {
perror("cfg_put_cstring");
}
"iicpbmp copy bit map for %s from %s to %s",
}
}
/*
* find_bitmap_cfg()
*
*/
int
find_bitmap_cfg(char *bitmap)
{
return (0);
return (setnumber);
}
}
}